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