Joomla CMS
4.2.2
Documentation des API du CMS Joomla en version 4.2.2
|
Fonctions membres publiques | |
setEvent (EventInterface $event) | |
addEvent (EventInterface $event) | |
hasEvent ($event) | |
getEvent ($name, $default=null) | |
removeEvent ($event) | |
getEvents () | |
clearEvents () | |
countEvents () | |
addListener (string $eventName, callable $callback, int $priority=0) | |
getListenerPriority ($eventName, callable $callback) | |
getListeners (?string $event=null) | |
hasListener (callable $callback, ?string $eventName=null) | |
removeListener (string $eventName, callable $listener) | |
clearListeners ($event=null) | |
countListeners ($event) | |
addSubscriber (SubscriberInterface $subscriber) | |
removeSubscriber (SubscriberInterface $subscriber) | |
dispatch (string $name, ?EventInterface $event=null) | |
triggerEvent ($event) | |
Attributs protégés | |
$events = [] | |
$listeners = [] | |
Fonctions membres privées | |
getDefaultEvent (string $name) | |
Implementation of a DispatcherInterface supporting prioritized listeners.
addEvent | ( | EventInterface | $event | ) |
Add an event to this dispatcher, only if it is not existing.
EventInterface | $event | The event. |
Références $this, et EventInterface\getName().
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émente DispatcherInterface.
Références ListenersPriorityQueue\add().
Référencé par Dispatcher\addSubscriber().
addSubscriber | ( | SubscriberInterface | $subscriber | ) |
Adds an event subscriber.
SubscriberInterface | $subscriber | The subscriber. |
Implémente DispatcherInterface.
Références $params, Dispatcher\addListener(), SubscriberInterface\getSubscribedEvents(), et Priority\NORMAL.
clearEvents | ( | ) |
Clear all events.
Références Dispatcher\$events.
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émente DispatcherInterface.
Références $this.
countEvents | ( | ) |
Count the number of registered event.
countListeners | ( | $event | ) |
Count the number of registered listeners for the given event.
string | $event | The event name. |
Implémente DispatcherInterface.
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émente DispatcherInterface.
Références Dispatcher\getDefaultEvent().
Référencé par Dispatcher\triggerEvent().
|
private |
Get an event object for the specified event name
string | $name | The event name to get an EventInterface object for |
Références $name.
Référencé par Dispatcher\dispatch(), et Dispatcher\triggerEvent().
getEvent | ( | $name, | |
$default = null |
|||
) |
Get the event object identified by the given name.
string | $name | The event name. |
mixed | $default | The default value if the event was not registered. |
getEvents | ( | ) |
Get the registered events.
Références Dispatcher\$events.
getListenerPriority | ( | $eventName, | |
callable | $callback | ||
) |
Get the priority of the given listener for the given event.
string | $eventName | The event to listen to. |
callable | $callback | A callable function |
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émente DispatcherInterface.
Références Dispatcher\$listeners, et null.
hasEvent | ( | $event | ) |
Tell if the given event has been added to this dispatcher.
EventInterface | string | $event | The event object or name. |
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 | $eventName | An optional event name to check a listener is subscribed to. |
Implémente DispatcherInterface.
removeEvent | ( | $event | ) |
Remove an event from this dispatcher. The registered listeners will remain.
EventInterface | string | $event | The event object or name. |
Références $this.
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émente DispatcherInterface.
Référencé par Dispatcher\removeSubscriber().
removeSubscriber | ( | SubscriberInterface | $subscriber | ) |
Removes an event subscriber.
SubscriberInterface | $subscriber | The subscriber. |
Implémente DispatcherInterface.
Références $params, SubscriberInterface\getSubscribedEvents(), et Dispatcher\removeListener().
setEvent | ( | EventInterface | $event | ) |
Set an event to the dispatcher. It will replace any event with the same name.
EventInterface | $event | The event. |
Références $this, et EventInterface\getName().
triggerEvent | ( | $event | ) |
Trigger an event.
EventInterface | string | $event | The event object or name. |
Références class, Dispatcher\dispatch(), et Dispatcher\getDefaultEvent().
|
protected |
Référencé par Dispatcher\clearEvents(), et Dispatcher\getEvents().
|
protected |
Référencé par Dispatcher\getListeners().