Class Dispatcher
Implementation of a DispatcherInterface supporting prioritized listeners.
- Joomla\Event\Dispatcher implements Joomla\Event\DispatcherInterface
Methods summary
public
|
#
setEvent(
Set an event to the dispatcher. It will replace any event with the same name. |
public
|
#
setListenerFilter( string $regex )
Sets a regular expression to filter the class methods when adding a listener. |
public
|
#
addEvent(
Add an event to this dispatcher, only if it is not existing. |
public
boolean
|
#
hasEvent(
Tell if the given event has been added to this dispatcher. |
public
|
|
public
|
#
removeEvent(
Remove an event from this dispatcher. The registered listeners will remain. |
public
|
|
public
|
|
public
integer
|
|
public
|
#
addListener( object|
Add a listener to this dispatcher, only if not already registered to these events. If no events are specified, it will be registered to all events matching it's methods name. In the case of a closure, you must specify at least one event name. |
public
mixed
|
#
getListenerPriority( object|
Get the priority of the given listener for the given event. |
public
object[]
|
#
getListeners(
Get the listeners registered to the given event. |
public
boolean
|
#
hasListener( object|
Tell if the given listener has been added. If an event is specified, it will tell if the listener is registered for that event. |
public
|
#
removeListener( object|
Remove the given listener from this dispatcher. If no event is specified, it will be removed from all events it is listening to. |
public
|
#
clearListeners(
Clear the listeners in this dispatcher. If an event is specified, the listeners will be cleared only for that event. |
public
integer
|
#
countListeners(
Count the number of registered listeners for the given event. |
public
|
Magic methods summary
Properties summary
protected
|
$events |
#
An array of registered events indexed by the event names. |
protected
string
|
$listenerFilter |
#
A regular expression that will filter listener method names. |
protected
|
$listeners |
#
An array of ListenersPriorityQueue indexed by the event names. |