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


PHP EventManagerInterface::addIdentifiers方法代碼示例

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

示例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);
 }
開發者ID:leonardovn86,項目名稱:zf2_basic2013,代碼行數:18,代碼來源:EventFeature.php

示例3: setEventManager

 public function setEventManager(EventManagerInterface $eventManager)
 {
     if ($eventManager !== NULL) {
         $eventManager->addIdentifiers(array(get_called_class()));
         $this->eventManager = $eventManager;
     }
     return $this;
 }
開發者ID:b-medias,項目名稱:bZF2,代碼行數:8,代碼來源:AbstractEvent.php

示例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;
 }
開發者ID:reliv,項目名稱:rcm-user,代碼行數:15,代碼來源:EventProvider.php

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

示例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');
     }
 }
開發者ID:t4web,項目名稱:base,代碼行數:17,代碼來源:DbRepository.php

示例7: setEventManager

 public function setEventManager(EventManagerInterface $eventManager)
 {
     $eventManager->addIdentifiers(get_called_class());
     $this->eventManager = $eventManager;
 }
開發者ID:eotg1910,項目名稱:shineisp2,代碼行數:5,代碼來源:ProductAttributeSetService.php

示例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;
 }
開發者ID:zfcampus,項目名稱:zf-rest,代碼行數:15,代碼來源:Resource.php

示例9: setEventManager

 /**
  * (non-PHPdoc)
  * 
  * @see \Zend\EventManager\EventManagerAwareInterface::setEventManager()
  */
 public function setEventManager(EventManagerInterface $events)
 {
     $events->addIdentifiers([__CLASS__, 'nodeservice']);
     $this->events = $events;
 }
開發者ID:alexsawallich,項目名稱:node,代碼行數:10,代碼來源:NodeService.php

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

示例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;
 }
開發者ID:lafaiDev,項目名稱:suive_com,代碼行數:12,代碼來源:Profiler.php

示例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;
    }
開發者ID:jbarentsen,項目名稱:drb,代碼行數:20,代碼來源:ContentValidationListener.php

示例13: setEventManager

 /**
  * Inject an EventManager instance
  *
  * @param  EventManagerInterface $eventManager
  * @return void
  */
 public function setEventManager(EventManagerInterface $eventManager)
 {
     $eventManager->addIdentifiers(['Aeris\\ZendRestModule\\RestException']);
     $this->eventManager = $eventManager;
 }
開發者ID:Kipperlenny,項目名稱:ZendRestModule,代碼行數:11,代碼來源:RestExceptionStrategy.php


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