/** * Set the event manager instance used by this context * * @param EventManagerInterface $events * @return void */ public static function setEventManager(EventManagerInterface $events) { $identifiers = array(__CLASS__, 'zpropel'); $events->setIdentifiers($identifiers); self::$events = $events; return; }
/** * Set the event manager instance used by this context * * @param EventManagerInterface $events * @return mixed */ public function setEventManager(EventManagerInterface $events) { $identifiers = array(__CLASS__, get_called_class()); $events->setIdentifiers($identifiers); $this->events = $events; return $this; }
/** * Inject an EventManager instance * * @param EventManagerInterface $eventManager * @return SendResponseListener */ public function setEventManager(EventManagerInterface $eventManager) { $eventManager->setIdentifiers(array(__CLASS__, get_class($this))); $this->eventManager = $eventManager; $this->attachDefaultListeners(); return $this; }
/** * @param EventManagerInterface $eventManager * @return self */ public function setEventManager(EventManagerInterface $eventManager) { $eventManager->setIdentifiers(array($this->eventIdentifier)); $this->evm = $eventManager; $this->events = $eventManager; return $this; }
/** * @inheritdoc */ public function withEventManager(EventManagerInterface $events) { $clone = clone $this; $events->setIdentifiers(array(__CLASS__, get_class($this))); $clone->events = $events; return $clone; }
/** * Set the event manager instance used by this context * * @param EventManagerInterface $events * @return mixed */ public function setEventManager(EventManagerInterface $events) { $events->setIdentifiers([__CLASS__, get_called_class()]); $this->events = $events; $this->attachDefaultListeners(); return $this; }
/** * (non-PHPdoc) * * @see \Zend\EventManager\EventManagerAwareInterface::setEventManager() */ public function setEventManager(EventManagerInterface $events) { $identifiers = $events->getIdentifiers(); $identifiers += [$this->eventIdentifier, __CLASS__]; $identifiers = array_unique($identifiers); $events->setIdentifiers($identifiers); $this->events = $events; }
/** * Get the event manager * * @return EventManagerInterface */ public function getEventManager() { if ($this->events === null) { $this->events = new EventManager(); $this->events->setIdentifiers([__CLASS__, get_class($this)]); } return $this->events; }
/** * @param EventManagerInterface $eventManager */ public function __construct(EventManagerInterface $eventManager) { $eventManager->setIdentifiers(array( __CLASS__, get_called_class(), 'SlmQueue\Worker\WorkerInterface' )); $this->eventManager = $eventManager; }
/** * 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 EventManagerInterface $events * @return $this */ public function setEventManager(EventManagerInterface $events) { $identifiers = array(__CLASS__, get_called_class()); if (isset($this->eventIdentifier)) { if (is_string($this->eventIdentifier) || is_array($this->eventIdentifier) || $this->eventIdentifier instanceof Traversable) { $identifiers = array_unique(array_merge($identifiers, (array) $this->eventIdentifier)); } elseif (is_object($this->eventIdentifier)) { $identifiers[] = $this->eventIdentifier; } } $events->setIdentifiers($identifiers); $this->events = $events; return $this; }
/** * Set the event manager instance used by this context * * @param EventManagerInterface $events * @return mixed */ public function setEventManager(EventManagerInterface $events) { $identifiers = array(current(explode('\\', get_called_class())), __CLASS__, get_called_class()); if (isset($this->eventIdentifier)) { if (is_string($this->eventIdentifier) || is_array($this->eventIdentifier) || $this->eventIdentifier instanceof Traversable) { $identifiers = array_unique(array_merge($identifiers, (array) $this->eventIdentifier)); } elseif (is_object($this->eventIdentifier)) { $identifiers[] = $this->eventIdentifier; } // silently ignore invalid eventIdentifier types } $events->setIdentifiers($identifiers); $this->events = $events; return $this; }
/** * Set the event manager instance used by this context * * @param EventManagerInterface $events * @return $this */ public function setEventManager(EventManagerInterface $events) { $identifiers = [__CLASS__, get_class($this)]; if (isset($this->eventIdentifier)) { if (is_string($this->eventIdentifier) || is_array($this->eventIdentifier) || $this->eventIdentifier instanceof \Traversable) { $identifiers = array_unique(array_merge($identifiers, (array) $this->eventIdentifier)); } elseif (is_object($this->eventIdentifier)) { $identifiers[] = $this->eventIdentifier; } // silently ignore invalid eventIdentifier types } $events->setIdentifiers($identifiers); $this->events = $events; $this->attachDefaultListener(); return $this; }
/** * {@inheritDoc} */ public function setEventManager(EventManagerInterface $eventManager) { $eventManager->setIdentifiers(array(__CLASS__, get_class($this))); $this->eventManager = $eventManager; }
/** * @param EventManagerInterface $eventManager */ public function setEventManager(EventManagerInterface $eventManager) { $eventManager->setIdentifiers(['Zend\\Stdlib\\DispatchableInterface', __CLASS__, get_class($this)]); $eventManager->attach(MvcEvent::EVENT_DISPATCH, array($this, 'onDispatch')); $this->eventManager = $eventManager; }
/** * Set the event manager instance used by this translator. * * @param EventManagerInterface $events * @return Translator */ public function setEventManager(EventManagerInterface $events) { $events->setIdentifiers(array(__CLASS__, get_class($this), 'translator')); $this->events = $events; return $this; }
/** * Provides the service's event manager. * * @param EventManagerInterface $events * @return EventManagerInterface */ public function setEventManager(EventManagerInterface $events) { $events->setIdentifiers(get_class($this)); return $this->events = $events; }
/** * Set the event manager instance * * @param EventManagerInterface $eventManager * @return Application */ public function setEventManager(EventManagerInterface $eventManager) { $eventManager->setIdentifiers(array( __CLASS__, get_called_class(), 'application', )); $this->events = $eventManager; return $this; }
/** * Set the event manager instance used by this context * * @param EventManagerInterface $events * @return AbstractController */ public function setEventManager(EventManagerInterface $events) { $events->setIdentifiers(array('Zend\\Stdlib\\DispatchableInterface', __CLASS__, get_called_class(), $this->eventIdentifier, substr(get_called_class(), 0, strpos(get_called_class(), '\\')))); $this->events = $events; $this->attachDefaultListeners(); return $this; }
/** * Set event manager instance * * @param EventManagerInterface $events * @return AnnotationBuilder */ public function setEventManager(EventManagerInterface $events) { $events->setIdentifiers(array(__CLASS__, get_class($this))); $events->attach(new ElementAnnotationsListener()); $events->attach(new FormAnnotationsListener()); $this->events = $events; return $this; }
/** * Set the event manager instance used by this module manager. * * @param EventManagerInterface $events * @return ModuleManager */ public function setEventManager(EventManagerInterface $events) { $events->setIdentifiers(array(__CLASS__, get_class($this), 'module_manager')); $this->events = $events; $this->attachDefaultListeners(); return $this; }
/** * Set event manager instance * * @param EventManagerInterface $events * @return AnnotationBuilder */ public function setEventManager(EventManagerInterface $events) { $events->setIdentifiers([__CLASS__, get_class($this)]); $events->attach(new EntityAnnotationListener()); $events->attach(new PropertyAnnotationListener()); $this->events = $events; return $this; }
/** * Set EventManager instance. * * @param EventManagerInterface $events Event manager * * @return void * @todo Deprecate `VuFind\Search' event namespace (2.2) */ public function setEventManager(EventManagerInterface $events) { $events->setIdentifiers([__CLASS__]); $this->events = $events; }
/** * Set the event manager instance. * * @param EventManagerInterface $events * @return self */ public function setEventManager(EventManagerInterface $events) { $events->setIdentifiers(array(__CLASS__, get_class($this), __NAMESPACE__ . '\\CommandDispatcherInterface')); $this->events = $events; return $this; }
public function setEventManager(EventManager $eventManager) { $eventManager->setIdentifiers(array(__CLASS__, get_called_class(), 'Ensemble\\Kernel')); $this->events = $eventManager; }
public function setEventManager(EventManagerInterface $eventManager) { $identifiers = $this->getEventManagerIdentifiers() + array(__NAMESPACE__, __CLASS__, get_class($this), 'Acl/Assertion'); $eventManager->setIdentifiers($identifiers); $this->events = $eventManager; }
/** * Set the event manager instance * * @param EventManagerInterface $events * @return View */ public function setEventManager(EventManagerInterface $events) { $events->setIdentifiers([__CLASS__, get_class($this)]); $this->events = $events; return $this; }
/** * Set EventManager instance. * * @param EventManagerInterface $events Event manager * * @return void * @todo Deprecate `VuFind\Search' event namespace (2.2) */ public function setEventManager(EventManagerInterface $events) { $events->setIdentifiers(['VuFind\\Search', 'VuFindSearch']); $this->events = $events; }
/** * Set the event manager instance * * @param EventManagerInterface $events * @return self */ public function setEventManager(EventManagerInterface $events) { $events->setIdentifiers([__CLASS__, get_class($this)]); $this->events = $events; $events->attach('getIdFromEntity', function (EventInterface $e) { $entity = $e->getParam('entity'); // Found id in array if (is_array($entity) && array_key_exists('id', $entity)) { return $entity['id']; } // No id in array, or not an object; return false if (is_array($entity) || !is_object($entity)) { return false; } // Found public id property on object if (isset($entity->id)) { return $entity->id; } // Found public id getter on object if (method_exists($entity, 'getid')) { return $entity->getId(); } // not found return false; }); return $this; }
public function setEventManager(EventManagerInterface $eventManager) { $eventManager->setIdentifiers(__CLASS__, get_called_class(), 'speckcart'); $eventManager->setEventClass('SpeckCart\\Service\\CartEvent'); $this->eventManager = $eventManager; return $this; }