本文整理匯總了PHP中Zend\EventManager\EventManagerInterface::setEventClass方法的典型用法代碼示例。如果您正苦於以下問題:PHP EventManagerInterface::setEventClass方法的具體用法?PHP EventManagerInterface::setEventClass怎麽用?PHP EventManagerInterface::setEventClass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend\EventManager\EventManagerInterface
的用法示例。
在下文中一共展示了EventManagerInterface::setEventClass方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setEventManager
/**
* Set the event manager instance used by this context
*
* @param EventManagerInterface $events
* @return \User\Authentication\Service
*/
public function setEventManager(EventManagerInterface $events)
{
$events->setEventClass(__NAMESPACE__ . '\\Event');
$events->attach(Event::EVENT_LOGIN, array($this, 'onLogin'), 1000);
$events->attach(Event::EVENT_LOGOUT, array($this, 'onLogout'), 0);
return parent::setEventManager($events);
}
示例2: 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);
}
示例3: setEventManager
public function setEventManager(EventManagerInterface $eventManager)
{
$eventManager->setIdentifiers(__CLASS__, get_called_class(), 'speckcart');
$eventManager->setEventClass('SpeckCart\\Service\\CartEvent');
$this->eventManager = $eventManager;
return $this;
}
示例4: setEventManager
/**
* Set the event manager instance used by this context
*
* @param EventManagerInterface $events
* @return \User\Authentication\Service
*/
public function setEventManager(EventManagerInterface $events)
{
$events->setEventClass(__NAMESPACE__ . '\\ModulesEvent')->attach(ModulesEvent::EVENT_MODULES, array($this, 'onModules'), 1000);
return parent::setEventManager($events);
}