Squiz Matrix
4.12.2
|
Public Member Functions | |
Event_Manager () | |
addEventListener (&$listener, $events=Array(), $broadcast_polling_events=true) | |
_broadcastRuntimeEvents (&$broadcaster, $event_name, $vars=Array()) | |
broadcastEvent (&$broadcaster, $event_name='', $vars=Array()) | |
_getDiscreteAssets ($assetid='', $type_code='', $side_of_link='minor', $info=Array()) | |
writeStaticEventsCacheFile () | |
installStaticEvents ($listeners=Array(), $listener_type_code='', $recursive_call=false) | |
_loadCachedEventListeners () | |
Public Member Functions inherited from MySource_Object | |
MySource_Object () | |
__sleep () | |
__wakeup () | |
Data Fields | |
$_runtime_event_listeners = Array() | |
$_runtime_listener_objects = Array() | |
Data Fields inherited from MySource_Object | |
$_tmp | |
Definition at line 59 of file event_manager.inc.
_broadcastRuntimeEvents | ( | & | $broadcaster, |
$event_name, | |||
$vars = Array() |
|||
) |
Broadcast events to the listeners that we added at runtime
&object | Asset $broadcaster the broadcaster of this event | |
string | $event_name | the event name being broadcasted |
Array | $vars | vars to be past to the listener |
private
Definition at line 128 of file event_manager.inc.
_getDiscreteAssets | ( | $assetid = '' , |
|
$type_code = '' , |
|||
$side_of_link = 'minor' , |
|||
$info = Array() |
|||
) |
Traverse up or down the tree for asset information
Collects all assets of the wanted type_code
integer | $assetid | the assetid of the broadcaster |
string | $type_code | the type_code of the listener |
string | $side_of_link | the size of link where the broadcaster exists |
array | $info | some information about the discretion of assets to return |
public
Definition at line 340 of file event_manager.inc.
_loadCachedEventListeners | ( | ) |
Load event listeners from the cache file to our _tmp array
private
Definition at line 573 of file event_manager.inc.
addEventListener | ( | & | $listener, |
$events = Array() , |
|||
$broadcast_polling_events = true |
|||
) |
Allows an object to listen to a runtime event
If the listener does not want to receive broadcasts from events that are currently polling, set the broadcast_polling_events to FALSE.
object | &$object | the object that is listening (use $this for yourself) |
array | $events | an array of events that the object wants to listen to |
boolean | $broadcast_polling_events | if TRUE any events that are polling will be broadcasted to this listener |
Definition at line 98 of file event_manager.inc.
broadcastEvent | ( | & | $broadcaster, |
$event_name = '' , |
|||
$vars = Array() |
|||
) |
To call an event function on an object that that has signed up to hear a particular event
eg.
$em = $GLOBALS['SQ_SYSTEM']->getEventManager(); $em->broadcastEvent($asset, 'eventName', Array('assetid' => $asset->id));
&object | Asset $asset the asset that triggered the event | |
string | $event_name | the name of the event that the asset is triggering |
Array | $vars | any information that the event want to tell the listener |
public
These will get filled in as necessary (once per broadcast event) Only need to fill them in if we need the data, otherwise we could do it at the top here.
Definition at line 170 of file event_manager.inc.
Event_Manager | ( | ) |
Constructor
Definition at line 78 of file event_manager.inc.
installStaticEvents | ( | $listeners = Array() , |
|
$listener_type_code = '' , |
|||
$recursive_call = false |
|||
) |
Add static event listeners
This function gets called from package manager of each package that has any management classes that have events to be installed
array | $listeners | array of listeners |
string | $listener_type_code | the type code of the listener |
boolean | $recursive_call | if TRUE this call is recursive |
private
Definition at line 504 of file event_manager.inc.
writeStaticEventsCacheFile | ( | ) |
Write the cache file of the current static events in the system
This occurs after all the packages have written their listeners to the system
Definition at line 471 of file event_manager.inc.