當前位置: 首頁>>代碼示例>>PHP>>正文


PHP EventManagerInterface::setEventClass方法代碼示例

本文整理匯總了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);
 }
開發者ID:gridguyz,項目名稱:core,代碼行數:13,代碼來源:Service.php

示例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);
 }
開發者ID:alex-patterson-webdev,項目名稱:arp-event,代碼行數:23,代碼來源:EventProviderTrait.php

示例3: setEventManager

 public function setEventManager(EventManagerInterface $eventManager)
 {
     $eventManager->setIdentifiers(__CLASS__, get_called_class(), 'speckcart');
     $eventManager->setEventClass('SpeckCart\\Service\\CartEvent');
     $this->eventManager = $eventManager;
     return $this;
 }
開發者ID:nclundsten,項目名稱:SpeckCart,代碼行數:7,代碼來源:CartService.php

示例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);
 }
開發者ID:gridguyz,項目名稱:core,代碼行數:11,代碼來源:Model.php


注:本文中的Zend\EventManager\EventManagerInterface::setEventClass方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。