removeCategoryTranslation() public méthode

Remove category-translation.
public removeCategoryTranslation ( Sulu\Bundle\CategoryBundle\Entity\CategoryTranslationInterface $categoryTranslation )
$categoryTranslation Sulu\Bundle\CategoryBundle\Entity\CategoryTranslationInterface
Exemple #1
0
 /**
  * {@inheritdoc}
  */
 public function delete(KeywordInterface $keyword, CategoryInterface $category)
 {
     $categoryTranslation = $category->findTranslationByLocale($keyword->getLocale());
     if ($categoryTranslation) {
         $keyword->removeCategoryTranslation($categoryTranslation);
         $categoryTranslation->removeKeyword($keyword);
         // FIXME category and meta will not be updated if only keyword was changed
         $category->setChanged(new \DateTime());
         $categoryTranslation->setChanged(new \DateTime());
     }
     if ($keyword->isReferenced()) {
         return false;
     }
     $this->entityManager->remove($keyword);
     return true;
 }