openmediavault  4.0 (Arrakis)
The open network attached storage solution
Public Member Functions | Static Public Member Functions | List of all members
OMV\Engine\Notify\Dispatcher Class Reference

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")
 

Detailed Description

is an configuration notification technology. It provides the possibility to simply monitor various events, e.g. on the configuration.

Constructor & Destructor Documentation

◆ __construct()

OMV\Engine\Notify\Dispatcher::__construct (   $name)

Constructor

Parameters
nameThe name of the dispatcher.

Member Function Documentation

◆ addListener()

OMV\Engine\Notify\Dispatcher::addListener (   $arg1,
  $arg2 = null,
  $arg3 = null,
  $arg4 = 20 
)

Add a listener to a given event message.

Parameters
arg1The event message type, e.g. OMV_NOTIFY_CREATE, OMV_NOTIFY_MODIFY, OMV_NOTIFY_PREDELETE, OMV_NOTIFY_DELETE or OMV_NOTIFY_MODIFY|OMV_NOTIFY_DELETE.
arg2The notification identifier that should be monitored, e.g. 'org.openmediavault.abc.xyz'.
arg3The callback function.
arg4The 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.

◆ dumpListeners()

OMV\Engine\Notify\Dispatcher::dumpListeners (   $id = "")

Dump all registered listeners sorted by their notification identifier.

Parameters
idThe notification identifier that should be monitored.

◆ getInstance()

static& OMV\Engine\Notify\Dispatcher::getInstance (   $name = "default")
static

Returns a dispatcher singleton.

Parameters
nameThe name of the notification dispatcher.
Returns
The dispatcher object.

◆ getListeners()

OMV\Engine\Notify\Dispatcher::getListeners ( )

Returns all listeners.

Returns
An array of listeners.

◆ getName()

OMV\Engine\Notify\Dispatcher::getName ( )

Get the name of the dispatcher. The name is the unique identifier of a dispatcher.

Returns
The name of the dispatcher.

◆ notify()

OMV\Engine\Notify\Dispatcher::notify (   $type,
  $id 
)

Notify all registered listeners.

Parameters
typeThe 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.
idThe notification identifier, e.g. 'org.openmediavault.abc.xyz'.
argXThe parameters to be passed.

The documentation for this class was generated from the following file: