Class Symfony\Component\EventDispatcher\EventDispatcher

InheritanceSymfony\Component\EventDispatcher\EventDispatcher
ImplementsSymfony\Component\EventDispatcher\EventDispatcherInterface
SubclassesSymfony\Component\EventDispatcher\ContainerAwareEventDispatcher

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

{@inheritdoc}

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

{@inheritdoc}

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

{@inheritdoc}

public void dispatch ( $eventName, Symfony\Component\EventDispatcher\Event $event null )
$eventName
$event
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

{@inheritdoc}

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

{@inheritdoc}

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

{@inheritdoc}

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

{@inheritdoc}

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