/** * Dispatch entity.delete on preRemove. * * @param Doctrine\ORM\Event\LifecycleEventArgs $args * @return void */ public function preRemove(LifecycleEventArgs $args) { $entityName = $this->getEntityName($args->getEntity()); $this->dispatcher->notify("{$entityName}.delete", new \Newscoop\EventDispatcher\Events\GenericEvent($this, array('id' => $this->getEntityId($args->getEntity(), $args->getEntityManager()), 'diff' => $this->getEntityProperties($args->getEntity(), $args->getEntityManager()), 'title' => $this->getEntityTitle($args->getEntity())))); }
/** * Creates and dispatches an event * * @see EventDispatcher::notify() * @param string $eventName * @param array $params * @return Event */ public function notify($eventName, array $params = array()) { $this->dispatcher->notify($e = $this->createEvent($eventName, $params)); return $e; }