/**
* {@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;
}