EventSource Class Reference
[Lib]
Sends events to all registered event sinks. More...
Inheritance diagram for EventSource:
Public Member Functions |
|
invoke_event ($event_name, $event_params, &$event_result) | |
Triggers events. |
|
invoke_event_no_result ($event_name, $event_params) | |
Invokes an event without result. |
|
register ($sink) | |
Register an event sink. |
|
Static Public Member Functions |
|
static | Instance () |
Returns singleton instance. |
|
Protected Member Functions |
|
__construct () | |
Cosntructor. |
Detailed Description
Sends events to all registered event sinks.
Definition at line 8 of file eventsource.cls.php.
Constructor & Destructor Documentation
EventSource::__construct | ( | ) | [protected] |
Cosntructor.
Definition at line 17 of file eventsource.cls.php.
Member Function Documentation
static EventSource::Instance | ( | ) | [static] |
Returns singleton instance.
- Returns:
- EventSource
Definition at line 26 of file eventsource.cls.php.
00026 { 00027 static $inst = null; 00028 if ($inst == null) { 00029 $inst = new EventSource(); 00030 } 00031 return $inst; 00032 }
EventSource::invoke_event | ( | $ | event_name, | |
$ | event_params, | |||
&$ | event_result | |||
) |
Triggers events.
Events can be anything, and they are invoked through the router One event is "cron", it has no parameters
- Parameters:
-
string Event name mixed Event parameter(s)
- Returns:
- Status
Implements IEventSource.
Definition at line 63 of file eventsource.cls.php.
00063 { 00064 $ret = new Status(); 00065 foreach($this->sinks as $sink) { 00066 if (method_exists($sink, 'on_event')) { 00067 $ret->merge($sink->on_event($event_name, $event_params, $event_result)); 00068 } 00069 } 00070 return $ret; 00071 }
EventSource::invoke_event_no_result | ( | $ | event_name, | |
$ | event_params | |||
) |
Invokes an event without result.
- Parameters:
-
string $event_name mixed $event_params
- Returns:
- Status
Implements IEventSource.
Definition at line 48 of file eventsource.cls.php.
00048 { 00049 $result = array(); 00050 return self::invoke_event($event_name, $event_params, $result); 00051 }
EventSource::register | ( | $ | sink | ) |
Register an event sink.
Definition at line 37 of file eventsource.cls.php.
The documentation for this class was generated from the following file:
- gyro/core/lib/components/eventsource.cls.php