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


PHP EventManagerInterface::detach方法代碼示例

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


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

示例1: detach

 /**
  * @param EventManagerInterface $events
  */
 public function detach(EventManagerInterface $events)
 {
     foreach ($this->handlers as $key => $handler) {
         $events->detach($handler);
         unset($this->handlers[$key]);
     }
 }
開發者ID:socialog,項目名稱:socialog,代碼行數:10,代碼來源:AbstractListenerAggregate.php

示例2: detach

 public function detach(EventManagerInterface $events)
 {
     foreach ($this->listeners as $index => $listener) {
         $events->detach($listener);
         unset($this->listeners[$index]);
     }
 }
開發者ID:raykolbe,項目名稱:ZfcTwig,代碼行數:7,代碼來源:Strategy.php

示例3: detach

 /**
  * @param EventManagerInterface $events
  */
 public function detach(EventManagerInterface $events)
 {
     foreach ($this->getListeners() as $index => $listener) {
         if ($events->detach($listener)) {
             $this->removeListener($index);
         }
     }
 }
開發者ID:eddiejaoude,項目名稱:codeception-zf2-codecoverage,代碼行數:11,代碼來源:C3.php

示例4: detach

 /**
  * {@inheritDoc}
  */
 public function detach(EventManagerInterface $e)
 {
     foreach ($this->listeners as $index => $listener) {
         if ($e->detach($listener)) {
             unset($this->listeners[$index]);
         }
     }
 }
開發者ID:NguyenQuiDuong,項目名稱:Funixtest,代碼行數:11,代碼來源:Template.php

示例5: detach

 /**
  * {@inheritDoc}
  */
 public function detach(EventManagerInterface $events)
 {
     foreach ($this->listeners as $index => $callback) {
         if ($events->detach($callback)) {
             unset($this->listeners[$index]);
         }
     }
 }
開發者ID:newage,項目名稱:annotations,代碼行數:11,代碼來源:AbstractAnnotationListener.php

示例6: detach

 /**
  * @param Events $events
  */
 public function detach(Events $events)
 {
     foreach ($this->listeners as $index => $listener) {
         if ($events->detach($listener)) {
             unset($this->listeners[$index]);
         }
     }
 }
開發者ID:simplicity-ag,項目名稱:NewRelic,代碼行數:11,代碼來源:AbstractListener.php

示例7: detach

 /**
  * Detach all previously attached listeners
  *
  * @param  EventManagerInterface $events
  * @return void
  */
 public function detach(EventManagerInterface $events)
 {
     foreach ($this->listeners as $key => $listener) {
         if ($events->detach($listener)) {
             unset($this->listeners[$key]);
         }
     }
 }
開發者ID:razvansividra,項目名稱:pnlzf2-1,代碼行數:14,代碼來源:ModuleLoaderListener.php

示例8: detach

 /**
  * {@inheritDoc}
  */
 public function detach(EventManagerInterface $events)
 {
     foreach ($this->handlers as $index => $listener) {
         if (false !== $events->detach($listener)) {
             unset($this->handlers[$index]);
         }
     }
 }
開發者ID:rhodium289,項目名稱:sandbox,代碼行數:11,代碼來源:Logger.php

示例9: detach

 /**
  * Detach aggregate listeners from the specified event manager
  * @param \Zend\EventManager\EventManagerInterface $oEvents
  * @return void
  */
 public function detach(\Zend\EventManager\EventManagerInterface $oEvents)
 {
     foreach ($this->listeners as $iIndex => $oListener) {
         if ($oEvents->detach($oListener)) {
             unset($this->listeners[$iIndex]);
         }
     }
 }
開發者ID:neilime,項目名稱:zf2-assets-bundle,代碼行數:13,代碼來源:JsCustomStrategy.php

示例10: detach

 /**
  * Detach all previously attached listeners
  *
  * @param EventManagerInterface $events
  *
  * @return void
  */
 public function detach(EventManagerInterface $events)
 {
     foreach ($this->listeners as $i => $listener) {
         if ($events->detach($listener)) {
             unset($this->listeners[$i]);
         }
     }
     return empty($this->listeners);
 }
開發者ID:utrenkner,項目名稱:YAWIK,代碼行數:16,代碼來源:DeferredListenerAggregate.php

示例11: detach

 /**
  * @param \Zend\EventManager\EventManagerInterface $oEventManager
  * @return \AssetsBundle\Service\Service
  */
 public function detach(\Zend\EventManager\EventManagerInterface $oEventManager)
 {
     foreach ($this->listeners as $iIndex => $oCallback) {
         if ($oEventManager->detach($oCallback)) {
             unset($this->listeners[$iIndex]);
         }
     }
     return $this;
 }
開發者ID:neilime,項目名稱:zf2-assets-bundle,代碼行數:13,代碼來源:Service.php

示例12: detach

 /**
  * (non-PHPdoc)
  *
  * @see \Zend\EventManager\ListenerAggregateInterface::detach()
  */
 public function detach(EventManagerInterface $events)
 {
     $sharedEvents = $events->getSharedManager();
     foreach ($this->listeners as $index => $listener) {
         if ($events->detach($listener)) {
             unset($this->listeners[$index]);
         }
     }
 }
開發者ID:jdpro,項目名稱:zf2-assetic-i18n,代碼行數:14,代碼來源:AsseticI18nConfigModifier.php

示例13: detach

 public function detach(EventManagerInterface $event)
 {
     if (!empty($this->listeners)) {
         foreach ($this->listeners as $index->{$listener}) {
             if ($event->detach($listener)) {
                 unset($this->listeners[$index]);
             }
         }
     }
 }
開發者ID:quangdungninh,項目名稱:zendvnteam,代碼行數:10,代碼來源:ShowInfoListener.php

示例14: detach

 /**
  * Detach all previously attached listeners
  *
  * @param  EventManagerInterface $events
  * @return ConfigListener
  */
 public function detach(EventManagerInterface $events)
 {
     foreach ($this->listeners as $key => $listener) {
         $events->detach($listener);
         unset($this->listeners[$key]);
     }
     $this->listeners = array();
     return $this;
 }
開發者ID:totolouis,項目名稱:ZF2-Auth,代碼行數:15,代碼來源:ConfigListener.php

示例15: detach

 public function detach(EventManagerInterface $events)
 {
     $events->detach($this->listener);
 }
開發者ID:mrubiosan,項目名稱:facade,代碼行數:4,代碼來源:FacadeBootstrapListener.php


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