本文整理汇总了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]);
}
示例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);
}
}
示例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;
}
示例4: send
public function send($sender = null)
{
$this->sender = $sender;
EventManager::getInstance()->send($this);
}
示例5: eventManager
/**
* Get event manager
* @return EventManager
*/
protected static function eventManager()
{
return EventManager::getInstance();
}
示例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);
}