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