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


PHP EventManager\EventManagerInterface類代碼示例

本文整理匯總了PHP中Zend\EventManager\EventManagerInterface的典型用法代碼示例。如果您正苦於以下問題:PHP EventManagerInterface類的具體用法?PHP EventManagerInterface怎麽用?PHP EventManagerInterface使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了EventManagerInterface類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: attach

 public function attach(EventManagerInterface $events, $priority = 1)
 {
     if (PHP_SAPI !== 'cli') {
         $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, [$this, 'onRoute']);
         $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, [$this, 'onRender']);
     }
 }
開發者ID:alex-oleshkevich,項目名稱:zf-extras,代碼行數:7,代碼來源:AclListener.php

示例2: attach

 /**
  *
  * {@inheritDoc}
  * @see \Zend\EventManager\ListenerAggregateInterface::attach()
  */
 public function attach(EventManagerInterface $em)
 {
     /*
      * attach the onDipatch() method to the MvcEvent::EVENT_DISPATCH event
      */
     $this->listeners[] = $em->attach(MvcEvent::EVENT_DISPATCH, array($this, 'onDispatch'), 100);
 }
開發者ID:decmade,項目名稱:zendAbacAcl,代碼行數:12,代碼來源:UserAttributeEvaluatorListener.php

示例3: attach

 /**
  * 注冊事件監聽器,由事件管理器回調。
  * 
  * @param EventManagerInterface $eventManager
  * @return AuthLoggerListener
  */
 public function attach(EventManagerInterface $eventManager)
 {
     $this->listeners[] = $eventManager->attach(AuthEvent::EVENT_VERIFY_POST, array($this, 'onVerifyPost'));
     $this->listeners[] = $eventManager->attach(AuthEvent::EVENT_TOKEN_POST, array($this, 'onTokenPost'));
     $this->listeners[] = $eventManager->attach(AuthEvent::EVENT_FAILURE, array($this, 'onFailure'));
     return $this;
 }
開發者ID:starflash,項目名稱:MobilePf-ZF2-Example,代碼行數:13,代碼來源:AuthLoggerListenerAbstract.php

示例4: attach

 public function attach(EventManagerInterface $events)
 {
     $events->attach(Collection::EVENT_AFTER_UPDATE, [$this, 'afterUpdate']);
     $events->attach(Collection::EVENT_AFTER_CREATE, [$this, 'afterCreate']);
     $events->attach(Collection::EVENT_BEFORE_CREATE, [$this, 'beforeCreate']);
     $events->attach(Collection::EVENT_AFTER_DELETE, [$this, 'afterDelete']);
 }
開發者ID:rostmefpoter,項目名稱:bh,代碼行數:7,代碼來源:Good.php

示例5: attach

 public function attach(EventManagerInterface $events)
 {
     $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'onPreDispatch'), 9999);
     $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, array($this, 'onPreDispatch'), 9999);
     $this->listeners[] = $events->attach(MvcEvent::EVENT_FINISH, array($this, 'onFinish'));
     $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, array($this, 'onPreRoute'), 9999);
 }
開發者ID:zend-modules,項目名稱:localemanager_outdated,代碼行數:7,代碼來源:SendResponseListener.php

示例6: attach

 /**
  * @param EventManager\EventManagerInterface $events
  */
 public function attach(EventManager\EventManagerInterface $events)
 {
     $this->listeners[] = $events->attach(DoctrineResourceEvent::EVENT_DELETE_PRE, array($this, 'delete'));
     $this->listeners[] = $events->attach(DoctrineResourceEvent::EVENT_FETCH_POST, array($this, 'fetch'));
     $this->listeners[] = $events->attach(DoctrineResourceEvent::EVENT_FETCH_ALL_PRE, array($this, 'fetchAll'));
     $this->listeners[] = $events->attach(DoctrineResourceEvent::EVENT_PATCH_PRE, array($this, 'patch'));
 }
開發者ID:dotuancd,項目名稱:secretary,代碼行數:10,代碼來源:NoteEventListener.php

示例7: attach

 /**
  * Attach one or more listeners.
  *
  * Implementors may add an optional $priority argument; the EventManager
  * implementation will pass this to the aggregate.
  *
  * @param EventManagerInterface $events
  * @param int                   $priority
  */
 public function attach(EventManagerInterface $events, $priority = 1)
 {
     $this->listeners[] = $events->attach('connect.pre', [$this, 'onConnect'], $priority);
     $this->listeners[] = $events->attach('disconnect.pre', [$this, 'onDisconnect'], $priority);
     $this->listeners[] = $events->attach('process.pre', [$this, 'onProcess'], $priority);
     $this->listeners[] = $events->attach('sendAction.pre', [$this, 'onSendAction'], $priority);
 }
開發者ID:thomasvargiu,項目名稱:pami-module,代碼行數:16,代碼來源:ConnectionStatusListener.php

示例8: attach

 /**
  * {@inheritDoc}
  */
 public function attach(EventManagerInterface $events)
 {
     $sharedEvents = $events->getSharedManager();
     $sharedEvents->attach('PI_CONTROLLER', MvcEvent::EVENT_DISPATCH, array($this, 'prepareErrorViewModel'), -85);
     $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH, array($this, 'prepareErrorViewModel'), -85);
     $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER, array($this, 'prepareErrorViewModel'), 100);
 }
開發者ID:Andyyang1981,項目名稱:pi,代碼行數:10,代碼來源:ErrorStrategy.php

示例9: attach

 /**
  * @param EventManagerInterface $events
  */
 public function attach(EventManagerInterface $events)
 {
     $this->listeners[] = $events->attach('configureColumn', [$this, 'handleHeaderAnnotation']);
     $this->listeners[] = $events->attach('configureColumn', [$this, 'handleSearchAnnotation']);
     $this->listeners[] = $events->attach('configureColumn', [$this, 'handleSuggestAnnotation']);
     $this->listeners[] = $events->attach('discoverTitle', [$this, 'handleTitleAnnotation']);
 }
開發者ID:PoetikDragon,項目名稱:USCSS,代碼行數:10,代碼來源:DatagridListener.php

示例10: attach

 /**
  * @param EventManagerInterface $events
  *
  * @return ServiceListener
  */
 public function attach(EventManagerInterface $events)
 {
     if (is_callable($this->overrideAppConfigHandler)) {
         $this->listeners[] = $events->attach(ModuleEvent::EVENT_LOAD_MODULES_POST, $this->overrideAppConfigHandler);
     }
     parent::attach($events);
 }
開發者ID:old-town,項目名稱:zf2-test-toolkit,代碼行數:12,代碼來源:ServiceListenerForTest.php

示例11: attach

 public function attach(EventManagerInterface $events)
 {
     $sharedEvents = $events->getSharedManager();
     $this->listeners[] = $sharedEvents->attach($this->attachTo, array('find.pre', 'fetchObject.pre'), array($this, 'checkCache'), 500);
     $this->listeners[] = $sharedEvents->attach($this->attachTo, array('find.post', 'fetchObject.post'), array($this, 'storeInCache'), -500);
     $this->listeners[] = $sharedEvents->attach($this->attachTo, array('update.post', 'delete.post'), array($this, 'removeFromCache'), 500);
 }
開發者ID:zealproject,項目名稱:zeal-orm,代碼行數:7,代碼來源:CacheListener.php

示例12: attach

 /**
  * Attach one or more listeners
  *
  * Implementors may add an optional $priority argument; the EventManager
  * implementation will pass this to the aggregate.
  *
  * @param EventManagerInterface $events
  *
  * @return void
  */
 public function attach(EventManagerInterface $events)
 {
     $this->listeners[] = $events->attach(MvcEvent::EVENT_RENDER, array($this, 'onRender'), 1000);
     $this->listeners[] = $events->attach(MvcEvent::EVENT_DISPATCH_ERROR, array($this, 'onDispatchError'), 100);
     $sharedEvents = $events->getSharedManager();
     $sharedEvents->attach('Zend\\Stdlib\\DispatchableInterface', MvcEvent::EVENT_DISPATCH, array($this, 'onDispatch'), 100);
 }
開發者ID:parrotcage,項目名稱:aves,代碼行數:17,代碼來源:ProblemListener.php

示例13: attach

 /**
  * {@inheritDoc}
  */
 public function attach(EventManagerInterface $events, $priority = 1)
 {
     //        $this->listeners[] = $events->attach(
     //            CommandDispatcherEvent::EVENT_PRE_HANDLE, array($this, 'onPreHandle'), $priority
     //        );
     $this->listeners[] = $events->attach(CommandDispatcherEvent::EVENT_DISPATCH, array($this, 'onDispatch'), $priority);
 }
開發者ID:detailnet,項目名稱:dfw-commanding-module,代碼行數:10,代碼來源:LoggingListener.php

示例14: attach

 /**
  * {@inheritdoc}
  */
 public function attach(EventManagerInterface $events)
 {
     if (!$this->isEnabled()) {
         return;
     }
     $this->listeners[] = $events->attach(MvcEvent::EVENT_ROUTE, array($this, 'onRoute'), 10000);
 }
開發者ID:Flesh192,項目名稱:magento,代碼行數:10,代碼來源:HttpMethodListener.php

示例15: attach

 /**
  * {@inheritdoc}
  */
 public function attach(EventManagerInterface $events, $priority = 1)
 {
     $callback = array($this, 'hashKey');
     $this->listeners[] = $events->attach('hasItem.pre', $callback, $priority);
     $this->listeners[] = $events->attach('getItem.pre', $callback, $priority);
     $this->listeners[] = $events->attach('setItem.pre', $callback, $priority);
 }
開發者ID:butkimtinh,項目名稱:ZendSkeletonApplication,代碼行數:10,代碼來源:HashKey.php


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