Event handler component.
More...
Event handler component.
Definition at line 8 of file Event.php.
◆ count()
Number of times an event has been triggered.
- Parameters
-
string | $name | Name of the event (usually with a class name prefix). |
- Returns
- int Counter (false if event does not exist).
Definition at line 49 of file Event.php.
◆ listen()
listen |
( |
|
$name, |
|
|
|
$callback, |
|
|
|
$prio = 50 |
|
) |
| |
Start listening to an event.
- Parameters
-
string | $name | Name of the event (usually with a class name prefix). |
function | $callback | Callback function (first parameter must be the sender; others are event specific). |
int | $prio | Callbacks with a lower prio value are called before ones with higher values. Otherwise callbacks are called in the order in which they where added. |
Definition at line 20 of file Event.php.
◆ trigger()
trigger |
( |
|
$name, |
|
|
|
$sender = null |
|
) |
| |
Trigger an event.
- Parameters
-
string | $name | Name of the event (usually with a class name prefix). |
object | $sender,... | The initiator of the event, and other parameters for the callback function. |
- Returns
- mixed Return value if one of the callbacks returned something other than null (this will also directly stop the chain). Returns null if none of the callbacks functions (if any) returned anything other than null.
Definition at line 32 of file Event.php.
◆ $_counts
◆ $_events
The documentation for this class was generated from the following file:
- /var/www/fred.local/vendor/rsi/fred/src/Rsi/Fred/Event.php