setChanged() public method

Note: This property is set automatically by the TimestampableSubscriber if not set manually.
public setChanged ( DateTime $changed ) : Sulu\Bundle\CategoryBundle\Entity\CategoryInterface
$changed DateTime
return Sulu\Bundle\CategoryBundle\Entity\CategoryInterface
Example #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;
 }