本文整理匯總了PHP中Zend\EventManager\EventManagerInterface::setIdentifiers方法的典型用法代碼示例。如果您正苦於以下問題:PHP EventManagerInterface::setIdentifiers方法的具體用法?PHP EventManagerInterface::setIdentifiers怎麽用?PHP EventManagerInterface::setIdentifiers使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend\EventManager\EventManagerInterface
的用法示例。
在下文中一共展示了EventManagerInterface::setIdentifiers方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setEventManager
/**
* 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;
}
示例2: setEventManager
/**
* 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;
}
示例3: setEventManager
/**
* 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;
}
示例4: setEventManager
/**
* @param EventManagerInterface $eventManager
* @return self
*/
public function setEventManager(EventManagerInterface $eventManager)
{
$eventManager->setIdentifiers(array($this->eventIdentifier));
$this->evm = $eventManager;
$this->events = $eventManager;
return $this;
}
示例5: withEventManager
/**
* @inheritdoc
*/
public function withEventManager(EventManagerInterface $events)
{
$clone = clone $this;
$events->setIdentifiers(array(__CLASS__, get_class($this)));
$clone->events = $events;
return $clone;
}
示例6: setEventManager
/**
* 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;
}
示例7: setEventManager
/**
* (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;
}
示例8: getEventManager
/**
* 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;
}
示例9: __construct
/**
* @param EventManagerInterface $eventManager
*/
public function __construct(EventManagerInterface $eventManager)
{
$eventManager->setIdentifiers(array(
__CLASS__,
get_called_class(),
'SlmQueue\Worker\WorkerInterface'
));
$this->eventManager = $eventManager;
}
示例10: setEventManager
/**
* 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);
}
示例11: setEventManager
/**
* @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;
}
示例12: setEventManager
/**
* 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;
}
示例13: setEventManager
/**
* 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;
}
示例14: setEventManager
/**
* {@inheritDoc}
*/
public function setEventManager(EventManagerInterface $eventManager)
{
$eventManager->setIdentifiers(array(__CLASS__, get_class($this)));
$this->eventManager = $eventManager;
}
示例15: setEventManager
/**
* @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;
}