|
openmediavault
4.0 (Arrakis)
The open network attached storage solution
|
Public Member Functions | |
| __construct ($name) | |
| getName () | |
| getListeners () | |
| addListener ($arg1, $arg2=null, $arg3=null, $arg4=20) | |
| notify ($type, $id) | |
| dumpListeners ($id="") | |
Static Public Member Functions | |
| static & | getInstance ($name="default") |
is an configuration notification technology. It provides the possibility to simply monitor various events, e.g. on the configuration.
| OMV\Engine\Notify\Dispatcher::__construct | ( | $name | ) |
Constructor
| name | The name of the dispatcher. |
| OMV\Engine\Notify\Dispatcher::addListener | ( | $arg1, | |
$arg2 = null, |
|||
$arg3 = null, |
|||
$arg4 = 20 |
|||
| ) |
Add a listener to a given event message.
| arg1 | The event message type, e.g. OMV_NOTIFY_CREATE, OMV_NOTIFY_MODIFY, OMV_NOTIFY_PREDELETE, OMV_NOTIFY_DELETE or OMV_NOTIFY_MODIFY|OMV_NOTIFY_DELETE. |
| arg2 | The notification identifier that should be monitored, e.g. 'org.openmediavault.abc.xyz'. |
| arg3 | The callback function. |
| arg4 | The sequence number of the called function. Default is 20. If you want a function to be execute as the first one then set it to 1. |
| OMV\Engine\Notify\Dispatcher::dumpListeners | ( | $id = "" | ) |
Dump all registered listeners sorted by their notification identifier.
| id | The notification identifier that should be monitored. |
|
static |
Returns a dispatcher singleton.
| name | The name of the notification dispatcher. |
| OMV\Engine\Notify\Dispatcher::getListeners | ( | ) |
Returns all listeners.
| OMV\Engine\Notify\Dispatcher::getName | ( | ) |
Get the name of the dispatcher. The name is the unique identifier of a dispatcher.
| OMV\Engine\Notify\Dispatcher::notify | ( | $type, | |
| $id | |||
| ) |
Notify all registered listeners.
| type | The event message type that should be announced, e.g. OMV_NOTIFY_CREATE, OMV_NOTIFY_MODIFY, OMV_NOTIFY_PREDELETE, OMV_NOTIFY_DELETE or OMV_NOTIFY_MODIFY|OMV_NOTIFY_DELETE. |
| id | The notification identifier, e.g. 'org.openmediavault.abc.xyz'. |
| argX | The parameters to be passed. |
1.8.13