Esempio n. 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);
 }
Esempio n. 2
0
 public function delete(EntityInterface $entity)
 {
     $id = $entity->getId();
     $this->clearCategories($id);
     return parent::delete($entity);
 }
Esempio n. 3
0
 /**
  * @param integer|string|EntityInterface $object
  * @return integer
  */
 public function filterPartObject2Id($object)
 {
     return (int) ($object instanceof EntityInterface) ? $object->getId() : $object;
 }
Esempio n. 4
0
 public function delete(EntityInterface $entity)
 {
     return $this->deleteById($entity->getId());
 }