Class Symfony\Component\EventDispatcher\EventDispatcher


The EventDispatcherInterface is the central point of Symfony's event listener system.

Listeners are registered on the manager and events are dispatched through the manager.

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
doDispatch() Triggers the listeners of an event. Symfony\Component\EventDispatcher\EventDispatcher

Method Details

addListener() public method


public void addListener ( $eventName, $listener, $priority 0 )
addSubscriber() public method


public void addSubscriber ( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber )
dispatch() public method


public void dispatch ( $eventName, Symfony\Component\EventDispatcher\Event $event null )
doDispatch() protected method

Triggers the listeners of an event.

This method can be overridden to add functionality that is executed for each listener.

protected void doDispatch ( $listeners, $eventName, Symfony\Component\EventDispatcher\Event $event )
$listeners callable[]

The event listeners

$eventName string

The name of the event to dispatch

$event Symfony\Component\EventDispatcher\Event

The event object to pass to the event handlers/listeners

getListenerPriority() public method

Gets the listener priority for a specific event.

Returns null if the event or the listener does not exist.

public int|null getListenerPriority ( $eventName, $listener )
$eventName string

The name of the event

$listener callable

The listener

return int|null

The event listener priority

getListeners() public method


public void getListeners ( $eventName null )
hasListeners() public method


public void hasListeners ( $eventName null )
removeListener() public method


public void removeListener ( $eventName, $listener )
removeSubscriber() public method


public void removeSubscriber ( Symfony\Component\EventDispatcher\EventSubscriberInterface $subscriber )