Documentation

TraceableEventDispatcher
in package
implements EventDispatcherInterface, ResetInterface

Collects some data about event listeners.

This event dispatcher delegates the dispatching to another one.

Tags
author

Fabien Potencier fabien@symfony.com

Interfaces, Classes and Traits

EventDispatcherInterface
The EventDispatcherInterface is the central point of Symfony's event listener system.
ResetInterface
Provides a way to reset an object to its initial state.

Table of Contents

$logger  : mixed
$stopwatch  : mixed
$callStack  : mixed
$currentRequestHash  : mixed
$dispatcher  : mixed
$orphanedEvents  : mixed
$requestStack  : mixed
$wrappedListeners  : mixed
__call()  : mixed
Proxies all method calls to the original event dispatcher.
__construct()  : mixed
addListener()  : mixed
Adds an event listener that listens on the specified events.
addSubscriber()  : mixed
Adds an event subscriber.
dispatch()  : object
{@inheritdoc}
getCalledListeners()  : array<string|int, mixed>
getListenerPriority()  : int|null
Gets the listener priority for a specific event.
getListeners()  : array<string|int, mixed>
Gets the listeners of a specific event or all listeners sorted by descending priority.
getNotCalledListeners()  : array<string|int, mixed>
getOrphanedEvents()  : array<string|int, mixed>
hasListeners()  : bool
Checks whether an event has any registered listeners.
removeListener()  : mixed
Removes an event listener from the specified events.
removeSubscriber()  : mixed
reset()  : mixed
afterDispatch()  : mixed
Called after dispatching the event.
beforeDispatch()  : mixed
Called before dispatching the event.
postProcess()  : void
preProcess()  : void
sortNotCalledListeners()  : mixed

Properties

Methods

__call()

Proxies all method calls to the original event dispatcher.

public __call(string $method, array<string|int, mixed> $arguments) : mixed
Parameters
$method : string

The method name

$arguments : array<string|int, mixed>

The method arguments

Return values
mixed

addListener()

Adds an event listener that listens on the specified events.

public addListener(string $eventName, mixed $listener, int $priority) : mixed
Parameters
$eventName : string
$listener : mixed

The listener

$priority : int

The higher this value, the earlier an event listener will be triggered in the chain (defaults to 0)

Return values
mixed

dispatch()

{@inheritdoc}

public dispatch(object $event[, string $eventName = null ]) : object
Parameters
$event : object
$eventName : string = null
Return values
object

getCalledListeners()

public getCalledListeners([Request $request = null ]) : array<string|int, mixed>
Parameters
$request : Request = null
Return values
array<string|int, mixed>

getListenerPriority()

Gets the listener priority for a specific event.

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

The listener

Return values
int|null

The event listener priority

getListeners()

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

public getListeners([string $eventName = null ]) : array<string|int, mixed>
Parameters
$eventName : string = null
Return values
array<string|int, mixed>

The event listeners for the specified event, or all event listeners by event name

getNotCalledListeners()

public getNotCalledListeners([Request $request = null ]) : array<string|int, mixed>
Parameters
$request : Request = null
Return values
array<string|int, mixed>

getOrphanedEvents()

public getOrphanedEvents([Request $request = null ]) : array<string|int, mixed>
Parameters
$request : Request = null
Return values
array<string|int, mixed>

hasListeners()

Checks whether an event has any registered listeners.

public hasListeners([string $eventName = null ]) : bool
Parameters
$eventName : string = null
Return values
bool

true if the specified event has any listeners, false otherwise

removeListener()

Removes an event listener from the specified events.

public removeListener(string $eventName, mixed $listener) : mixed
Parameters
$eventName : string
$listener : mixed

The listener to remove

Return values
mixed

afterDispatch()

Called after dispatching the event.

protected afterDispatch(string $eventName, object $event) : mixed
Parameters
$eventName : string
$event : object
Return values
mixed

beforeDispatch()

Called before dispatching the event.

protected beforeDispatch(string $eventName, object $event) : mixed
Parameters
$eventName : string
$event : object
Return values
mixed

postProcess()

private postProcess(string $eventName) : void
Parameters
$eventName : string
Return values
void

preProcess()

private preProcess(string $eventName) : void
Parameters
$eventName : string
Return values
void

sortNotCalledListeners()

private sortNotCalledListeners(array<string|int, mixed> $a, array<string|int, mixed> $b) : mixed
Parameters
$a : array<string|int, mixed>
$b : array<string|int, mixed>
Return values
mixed

Search results