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); }
public function save(EntityInterface $entity) { $categories = $entity->getCategoriesIds(); parent::save($entity); $id = $entity->getId(); $this->clearCategories($id); $this->saveCategories($id, $categories); }