예제 #1
0
 public function save(EntityInterface $entity)
 {
     /** @var UserProvider $entity */
     $created = $entity->getCreated();
     if (is_null($created)) {
         $entity->setCreated(new \DateTime());
     }
     $entity->setChanged(new \DateTime());
     return parent::save($entity);
 }
예제 #2
0
 public function save(EntityInterface $entity)
 {
     $categories = $entity->getCategoriesIds();
     parent::save($entity);
     $id = $entity->getId();
     $this->clearCategories($id);
     $this->saveCategories($id, $categories);
 }