Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques | |
dispatch (string $name, ?EventInterface $event=null) | |
addListener (string $eventName, callable $callback, int $priority=0) | |
clearListeners ($event=null) | |
countListeners ($event) | |
getListeners (?string $event=null) | |
hasListener (callable $callback, ?string $eventName=null) | |
removeListener (string $eventName, callable $listener) | |
addSubscriber (SubscriberInterface $subscriber) | |
removeSubscriber (SubscriberInterface $subscriber) | |
Interface for event dispatchers.
addListener | ( | string | $eventName, |
callable | $callback, | ||
int | $priority = 0 |
||
) |
Attaches a listener to an event
string | $eventName | The event to listen to. |
callable | $callback | A callable function. |
integer | $priority | The priority at which the $callback executed. |
Implémenté dans Dispatcher.
Référencé par Session\buildSession().
addSubscriber | ( | SubscriberInterface | $subscriber | ) |
Adds an event subscriber.
SubscriberInterface | $subscriber | The subscriber. |
Implémenté dans Dispatcher.
clearListeners | ( | $event = null | ) |
Clear the listeners in this dispatcher.
If an event is specified, the listeners will be cleared only for that event.
string | $event | The event name. |
Implémenté dans Dispatcher.
countListeners | ( | $event | ) |
Count the number of registered listeners for the given event.
string | $event | The event name. |
Implémenté dans Dispatcher.
dispatch | ( | string | $name, |
?EventInterface | $event = null |
||
) |
Dispatches an event to all registered listeners.
string | $name | The name of the event to dispatch. |
EventInterface | $event | The event to pass to the event handlers/listeners. If not supplied, an empty EventInterface instance is created. Note, not passing an event is deprecated and will be required as of 3.0. |
Implémenté dans Dispatcher.
getListeners | ( | ?string | $event = null | ) |
Get the listeners registered to the given event.
string | null | $event | The event to fetch listeners for or null to fetch all listeners |
Implémenté dans Dispatcher.
hasListener | ( | callable | $callback, |
?string | $eventName = null |
||
) |
Tell if the given listener has been added.
If an event is specified, it will tell if the listener is registered for that event.
callable | $callback | The callable to check is listening to the event. |
string | null | $eventName | An optional event name to check a listener is subscribed to. |
Implémenté dans Dispatcher.
removeListener | ( | string | $eventName, |
callable | $listener | ||
) |
Removes an event listener from the specified event.
string | $eventName | The event to remove a listener from. |
callable | $listener | The listener to remove. |
Implémenté dans Dispatcher.
removeSubscriber | ( | SubscriberInterface | $subscriber | ) |
Removes an event subscriber.
SubscriberInterface | $subscriber | The subscriber. |
Implémenté dans Dispatcher.