Open Journal Systems  3.3.0
Symfony\Component\EventDispatcher\EventDispatcher Class Reference
Inheritance diagram for Symfony\Component\EventDispatcher\EventDispatcher:
Symfony\Component\EventDispatcher\EventDispatcherInterface Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher

Public Member Functions

 addListener ($eventName, $listener, $priority=0)
 
 addListener ($eventName, $listener, $priority=0)
 
 addSubscriber (EventSubscriberInterface $subscriber)
 
 addSubscriber (EventSubscriberInterface $subscriber)
 
 dispatch ($eventName, Event $event=null)
 
 dispatch ($eventName, Event $event=null)
 
 getListenerPriority ($eventName, $listener)
 
 getListenerPriority ($eventName, $listener)
 
 getListeners ($eventName=null)
 
 getListeners ($eventName=null)
 
 hasListeners ($eventName=null)
 
 hasListeners ($eventName=null)
 
 removeListener ($eventName, $listener)
 
 removeListener ($eventName, $listener)
 
 removeSubscriber (EventSubscriberInterface $subscriber)
 
 removeSubscriber (EventSubscriberInterface $subscriber)
 

Protected Member Functions

 doDispatch ($listeners, $eventName, Event $event)
 
 doDispatch ($listeners, $eventName, Event $event)
 

Detailed Description

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.

Author
Guilherme Blanco guilh.nosp@m.erme.nosp@m.blanc.nosp@m.o@ho.nosp@m.tmail.nosp@m..com
Jonathan Wage jonwa.nosp@m.ge@g.nosp@m.mail..nosp@m.com
Roman Borschel roman.nosp@m.@cod.nosp@m.e-fac.nosp@m.tory.nosp@m..org
Bernhard Schussek bschu.nosp@m.ssek.nosp@m.@gmai.nosp@m.l.co.nosp@m.m
Fabien Potencier fabie.nosp@m.n@sy.nosp@m.mfony.nosp@m..com
Jordi Boggiano j.bog.nosp@m.gian.nosp@m.o@sel.nosp@m.d.be
Jordan Alliot jorda.nosp@m.n.al.nosp@m.liot@.nosp@m.gmai.nosp@m.l.com

Definition at line 28 of file lib/vendor/symfony/event-dispatcher/EventDispatcher.php.

Member Function Documentation

◆ addListener() [1/2]

Symfony\Component\EventDispatcher\EventDispatcher::addListener (   $eventName,
  $listener,
  $priority = 0 
)

{Adds an event listener that listens on the specified events.

Parameters
string$eventNameThe event to listen on
callable$listenerThe listener
int$priorityThe higher this value, the earlier an event listener will be triggered in the chain (defaults to 0)
}

Implements Symfony\Component\EventDispatcher\EventDispatcherInterface.

Definition at line 112 of file lib/vendor/symfony/event-dispatcher/EventDispatcher.php.

Referenced by Symfony\Component\EventDispatcher\EventDispatcher\addSubscriber(), and Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher\lazyLoad().

◆ addListener() [2/2]

Symfony\Component\EventDispatcher\EventDispatcher::addListener (   $eventName,
  $listener,
  $priority = 0 
)

{Adds an event listener that listens on the specified events.

Parameters
string$eventNameThe event to listen on
callable$listenerThe listener
int$priorityThe higher this value, the earlier an event listener will be triggered in the chain (defaults to 0)
}

Implements Symfony\Component\EventDispatcher\EventDispatcherInterface.

Definition at line 112 of file vendor/symfony/event-dispatcher/EventDispatcher.php.

◆ addSubscriber() [1/2]

Symfony\Component\EventDispatcher\EventDispatcher::addSubscriber ( EventSubscriberInterface  $subscriber)

{Adds an event subscriber.The subscriber is asked for all the events he is interested in and added as a listener for these events.}

Implements Symfony\Component\EventDispatcher\EventDispatcherInterface.

Definition at line 137 of file vendor/symfony/event-dispatcher/EventDispatcher.php.

References Symfony\Component\EventDispatcher\EventDispatcher\addListener(), and Symfony\Component\EventDispatcher\EventSubscriberInterface\getSubscribedEvents().

◆ addSubscriber() [2/2]

Symfony\Component\EventDispatcher\EventDispatcher::addSubscriber ( EventSubscriberInterface  $subscriber)

{Adds an event subscriber.The subscriber is asked for all the events he is interested in and added as a listener for these events.}

Implements Symfony\Component\EventDispatcher\EventDispatcherInterface.

Definition at line 137 of file lib/vendor/symfony/event-dispatcher/EventDispatcher.php.

References Symfony\Component\EventDispatcher\EventDispatcher\addListener(), and Symfony\Component\EventDispatcher\EventSubscriberInterface\getSubscribedEvents().

◆ dispatch() [1/2]

Symfony\Component\EventDispatcher\EventDispatcher::dispatch (   $eventName,
Event  $event = null 
)

{Dispatches an event to all registered listeners.

Parameters
string$eventNameThe name of the event to dispatch. The name of the event is the name of the method that is invoked on listeners.
Event$eventThe event to pass to the event handlers/listeners If not supplied, an empty Event instance is created
Returns
Event
}

Implements Symfony\Component\EventDispatcher\EventDispatcherInterface.

Definition at line 36 of file lib/vendor/symfony/event-dispatcher/EventDispatcher.php.

References Symfony\Component\EventDispatcher\EventDispatcher\doDispatch(), and Symfony\Component\EventDispatcher\EventDispatcher\getListeners().

◆ dispatch() [2/2]

Symfony\Component\EventDispatcher\EventDispatcher::dispatch (   $eventName,
Event  $event = null 
)

{Dispatches an event to all registered listeners.

Parameters
string$eventNameThe name of the event to dispatch. The name of the event is the name of the method that is invoked on listeners.
Event$eventThe event to pass to the event handlers/listeners If not supplied, an empty Event instance is created
Returns
Event
}

Implements Symfony\Component\EventDispatcher\EventDispatcherInterface.

Definition at line 36 of file vendor/symfony/event-dispatcher/EventDispatcher.php.

References Symfony\Component\EventDispatcher\EventDispatcher\doDispatch(), and Symfony\Component\EventDispatcher\EventDispatcher\getListeners().

◆ doDispatch() [1/2]

Symfony\Component\EventDispatcher\EventDispatcher::doDispatch (   $listeners,
  $eventName,
Event  $event 
)
protected

Triggers the listeners of an event.

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

Parameters
callable[]$listenersThe event listeners
string$eventNameThe name of the event to dispatch
Event$eventThe event object to pass to the event handlers/listeners

Definition at line 178 of file lib/vendor/symfony/event-dispatcher/EventDispatcher.php.

References Symfony\Component\EventDispatcher\Event\isPropagationStopped().

Referenced by Symfony\Component\EventDispatcher\EventDispatcher\dispatch().

◆ doDispatch() [2/2]

Symfony\Component\EventDispatcher\EventDispatcher::doDispatch (   $listeners,
  $eventName,
Event  $event 
)
protected

Triggers the listeners of an event.

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

Parameters
callable[]$listenersThe event listeners
string$eventNameThe name of the event to dispatch
Event$eventThe event object to pass to the event handlers/listeners

Definition at line 178 of file vendor/symfony/event-dispatcher/EventDispatcher.php.

References Symfony\Component\EventDispatcher\Event\isPropagationStopped().

◆ getListenerPriority() [1/2]

Symfony\Component\EventDispatcher\EventDispatcher::getListenerPriority (   $eventName,
  $listener 
)

Gets the listener priority for a specific event.

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

Parameters
string$eventNameThe name of the event
callable$listenerThe listener
Returns
int|null The event listener priority

Reimplemented in Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher, and Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher.

Definition at line 88 of file vendor/symfony/event-dispatcher/EventDispatcher.php.

◆ getListenerPriority() [2/2]

Symfony\Component\EventDispatcher\EventDispatcher::getListenerPriority (   $eventName,
  $listener 
)

Gets the listener priority for a specific event.

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

Parameters
string$eventNameThe name of the event
callable$listenerThe listener
Returns
int|null The event listener priority

Reimplemented in Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher, and Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher.

Definition at line 88 of file lib/vendor/symfony/event-dispatcher/EventDispatcher.php.

◆ getListeners() [1/2]

Symfony\Component\EventDispatcher\EventDispatcher::getListeners (   $eventName = null)

{Gets the listeners of a specific event or all listeners sorted by descending priority.

Parameters
string$eventNameThe name of the event
Returns
array The event listeners for the specified event, or all event listeners by event name
}

Implements Symfony\Component\EventDispatcher\EventDispatcherInterface.

Reimplemented in Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher, and Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher.

Definition at line 55 of file lib/vendor/symfony/event-dispatcher/EventDispatcher.php.

Referenced by Symfony\Component\EventDispatcher\EventDispatcher\dispatch(), and Symfony\Component\EventDispatcher\EventDispatcher\hasListeners().

◆ getListeners() [2/2]

Symfony\Component\EventDispatcher\EventDispatcher::getListeners (   $eventName = null)

{Gets the listeners of a specific event or all listeners sorted by descending priority.

Parameters
string$eventNameThe name of the event
Returns
array The event listeners for the specified event, or all event listeners by event name
}

Implements Symfony\Component\EventDispatcher\EventDispatcherInterface.

Reimplemented in Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher, and Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher.

Definition at line 55 of file vendor/symfony/event-dispatcher/EventDispatcher.php.

◆ hasListeners() [1/2]

Symfony\Component\EventDispatcher\EventDispatcher::hasListeners (   $eventName = null)

{Checks whether an event has any registered listeners.

Parameters
string$eventNameThe name of the event
Returns
bool true if the specified event has any listeners, false otherwise
}

Implements Symfony\Component\EventDispatcher\EventDispatcherInterface.

Reimplemented in Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher, and Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher.

Definition at line 104 of file lib/vendor/symfony/event-dispatcher/EventDispatcher.php.

References Symfony\Component\EventDispatcher\EventDispatcher\getListeners().

◆ hasListeners() [2/2]

Symfony\Component\EventDispatcher\EventDispatcher::hasListeners (   $eventName = null)

{Checks whether an event has any registered listeners.

Parameters
string$eventNameThe name of the event
Returns
bool true if the specified event has any listeners, false otherwise
}

Implements Symfony\Component\EventDispatcher\EventDispatcherInterface.

Reimplemented in Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher, and Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher.

Definition at line 104 of file vendor/symfony/event-dispatcher/EventDispatcher.php.

References Symfony\Component\EventDispatcher\EventDispatcher\getListeners().

◆ removeListener() [1/2]

Symfony\Component\EventDispatcher\EventDispatcher::removeListener (   $eventName,
  $listener 
)

{Removes an event listener from the specified events.

Parameters
string$eventNameThe event to remove a listener from
callable$listenerThe listener to remove
}

Implements Symfony\Component\EventDispatcher\EventDispatcherInterface.

Reimplemented in Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher, and Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher.

Definition at line 121 of file lib/vendor/symfony/event-dispatcher/EventDispatcher.php.

Referenced by Symfony\Component\EventDispatcher\EventDispatcher\removeSubscriber().

◆ removeListener() [2/2]

Symfony\Component\EventDispatcher\EventDispatcher::removeListener (   $eventName,
  $listener 
)

{Removes an event listener from the specified events.

Parameters
string$eventNameThe event to remove a listener from
callable$listenerThe listener to remove
}

Implements Symfony\Component\EventDispatcher\EventDispatcherInterface.

Reimplemented in Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher, and Symfony\Component\EventDispatcher\ContainerAwareEventDispatcher.

Definition at line 121 of file vendor/symfony/event-dispatcher/EventDispatcher.php.

◆ removeSubscriber() [1/2]

◆ removeSubscriber() [2/2]


The documentation for this class was generated from the following file: