/** * Initialize feature and trigger "preInitialize" event * * Ensures that the composed TableGateway has identifiers based on the * class name, and that the event target is set to the TableGateway * instance. It then triggers the "preInitialize" event. * * @return void */ public function preInitialize() { if (get_class($this->tableGateway) != 'Zend\\Db\\TableGateway\\TableGateway') { $this->eventManager->addIdentifiers(get_class($this->tableGateway)); } $this->event->setTarget($this->tableGateway); $this->event->setName(static::EVENT_PRE_INITIALIZE); $this->eventManager->trigger($this->event); }
/** * Initialize feature and trigger "preInitialize" event * * Ensures that the composed TableGateway has identifiers based on the * class name, and that the event target is set to the TableGateway * instance. It then triggers the "preInitialize" event. * * @return void */ public function preInitialize() { if (get_class($this->tableGateway) != 'Zend\\Db\\TableGateway\\TableGateway') { $this->eventManager->addIdentifiers(get_class($this->tableGateway)); } $this->event->setTarget($this->tableGateway); $this->event->setName(__FUNCTION__); $this->eventManager->trigger($this->event); }
public function setEventManager(EventManagerInterface $eventManager) { if ($eventManager !== NULL) { $eventManager->addIdentifiers(array(get_called_class())); $this->eventManager = $eventManager; } return $this; }
/** * setEventManager - Set the event manager instance used by this context * * @param EventManagerInterface $eventManager events * * @return $this */ public function setEventManager(EventManagerInterface $eventManager) { $identifiers = [__CLASS__, get_called_class()]; $eventManager->addIdentifiers($identifiers); //$eventManager->setIdentifiers($identifiers); $this->eventManager = $eventManager; return $this; }
/** * setEventManager * * Set the event manager instance, by default add the implementing classes * name as the default identities * * Pass the new instance to the prepare method to allow for default * event manager configuration in child classes. * * @param \Zend\EventManager\EventManagerInterface $eventManager */ public function setEventManager(EventManagerInterface $eventManager) { $this->eventManager = $eventManager; $eventManager->setIdentifiers([__CLASS__, get_class($this)]); if (isset($this->eventManagerIds) && is_array($this->eventManagerIds)) { $eventManager->addIdentifiers($this->eventManagerIds); } if (isset($this->eventClassName)) { $eventManager->setEventClass($this->eventClassName); } $this->prepareEventManager($eventManager); }
/** * @param $name * @param $entity */ private function trigger($name, &$entity) { if (!empty($entity) && $entity instanceof Collection) { $this->eventManager->addIdentifiers(get_class($entity->getFirst())); } else { $this->eventManager->addIdentifiers(get_class($entity)); } $event = new Event($name, $this, compact('entity')); $this->eventManager->trigger($event); if ($event->getParam('entity') && $event->getParam('entity') instanceof EntityInterface) { $entity = $event->getParam('entity'); } }
public function setEventManager(EventManagerInterface $eventManager) { $eventManager->addIdentifiers(get_called_class()); $this->eventManager = $eventManager; }
/** * Set event manager instance * * Sets the event manager identifiers to the current class, this class, and * the resource interface. * * @param EventManagerInterface $events * @return self */ public function setEventManager(EventManagerInterface $events) { $events->addIdentifiers([get_class($this), __CLASS__, 'ZF\\Rest\\ResourceInterface']); $this->events = $events; return $this; }
/** * (non-PHPdoc) * * @see \Zend\EventManager\EventManagerAwareInterface::setEventManager() */ public function setEventManager(EventManagerInterface $events) { $events->addIdentifiers([__CLASS__, 'nodeservice']); $this->events = $events; }
/** * Inject an EventManager instance * * @param EventManagerInterface $eventManager * @return void */ public function setEventManager(EventManagerInterface $eventManager) { $eventManager->addIdentifiers(array(get_class($this), __CLASS__)); $this->events = $eventManager; }
/** * Set the event manager instance * * @param EventManagerInterface $eventManager * @return self */ public function setEventManager(EventManagerInterface $eventManager) { $eventManager->addIdentifiers(array(__CLASS__, get_called_class(), 'profiler')); $this->eventManager = $eventManager; return $this; }
/** * Set event manager instance * * Sets the event manager identifiers to the current class, this class, and * the resource interface. * * @param EventManagerInterface $events * @return ContentValidationListener */ public function setEventManager(EventManagerInterface $events) { $events->addIdentifiers(array( get_class($this), __CLASS__, self::EVENT_BEFORE_VALIDATE )); $this->events = $events; return $this; }
/** * Inject an EventManager instance * * @param EventManagerInterface $eventManager * @return void */ public function setEventManager(EventManagerInterface $eventManager) { $eventManager->addIdentifiers(['Aeris\\ZendRestModule\\RestException']); $this->eventManager = $eventManager; }