当前位置: 首页>>代码示例>>PHP>>正文


PHP EventManager::getInstance方法代码示例

本文整理汇总了PHP中EventManager::getInstance方法的典型用法代码示例。如果您正苦于以下问题:PHP EventManager::getInstance方法的具体用法?PHP EventManager::getInstance怎么用?PHP EventManager::getInstance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EventManager的用法示例。


在下文中一共展示了EventManager::getInstance方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: disconnect

 public function disconnect($keyEvent = NULL, $callable = NULL)
 {
     if ($keyEvent === NULL and $callable == NULL) {
         EventManager::getInstance()->disconnect($this);
         return;
     }
     if ($keyEvent !== NULL and $callable == NULL) {
         EventManager::getInstance()->disconnect($keyEvent, $this);
         return;
     }
     EventManager::getInstance()->disconnect($keyEvent, [$this, $callable]);
 }
开发者ID:coretyson,项目名称:coretyson,代码行数:12,代码来源:EventItemTrait.php

示例2: __construct

 private function __construct()
 {
     try {
         // initialize the event manager and notification classes
         $this->eventManager = EventManager::getInstance();
         $this->notification = ClaroNotification::getInstance();
         $this->notifier = ClaroNotifier::getInstance();
         // initialize logger
         $this->logger = new Logger();
         $this->moduleLabelStack = array();
         if (isset($GLOBALS['tlabelReq'])) {
             $this->pushModuleLabel($GLOBALS['tlabelReq']);
             pushClaroMessage("Set current module to {$GLOBALS['tlabelReq']}", 'debug');
         }
     } catch (Exception $e) {
         die($e);
     }
 }
开发者ID:rhertzog,项目名称:lcs,代码行数:18,代码来源:claroline.lib.php

示例3: loadFile

 static function loadFile($className, $thr = true)
 {
     $folder = explode('\\', $className);
     $path = APP_FOLDER . DS . 'src';
     foreach ($folder as $value) {
         $path .= DS . $value;
     }
     $path .= '.php';
     if (!file_exists($path)) {
         if ($thr) {
             throw new \Exception("the file {$path} does not exist");
         } else {
             return false;
         }
     }
     if (EventManager::getInstance()) {
         EventManager::getInstance()->event('factory.load', null, $path);
     }
     include_once $path;
 }
开发者ID:skank,项目名称:skankydev,代码行数:20,代码来源:Factory.php

示例4: send

 public function send($sender = null)
 {
     $this->sender = $sender;
     EventManager::getInstance()->send($this);
 }
开发者ID:rasuldev,项目名称:torino,代码行数:5,代码来源:event.php

示例5: eventManager

 /**
  * Get event manager
  * @return EventManager
  */
 protected static function eventManager()
 {
     return EventManager::getInstance();
 }
开发者ID:Webiny,项目名称:Framework,代码行数:8,代码来源:EventManagerTrait.php

示例6: removeListener

 /**
  * unregister event listener
  * @access public
  * @static
  * @param string eventype type of event watching by the listener
  * @param string id listener ID
  * @return boolean
  */
 public static function removeListener($eventType, $id)
 {
     $mngr = EventManager::getInstance();
     return $mngr->unregister($eventType, $id);
 }
开发者ID:rhertzog,项目名称:lcs,代码行数:13,代码来源:event.lib.php


注:本文中的EventManager::getInstance方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。