Skip to content

Commit

Permalink
default event manager
Browse files Browse the repository at this point in the history
  • Loading branch information
Denis Smetannikov committed Aug 2, 2017
1 parent fd8f122 commit 88f25bd
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/EventManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ class EventManager
const HIGH = 500;
const HIGHEST = 1000;

/**
* @var EventManager
*/
static protected $defaultManager;

/**
* The list of listeners
* @var array
Expand Down Expand Up @@ -348,4 +353,20 @@ public function cleanEventName($eventName)

return $eventName;
}

/**
* @param EventManager $eManager
*/
public static function setDefault(EventManager $eManager)
{
self::$defaultManager = $eManager;
}

/**
* @return EventManager
*/
public static function getDefault()
{
return self::$defaultManager;
}
}

0 comments on commit 88f25bd

Please sign in to comment.