\Symfony\Component\EventDispatcherGenericEvent

Event encapsulation class.

Encapsulates events thus decoupling the observer from the subject they encapsulate.

Summary

Methods
Properties
Constants
isPropagationStopped()
stopPropagation()
__construct()
getSubject()
getArgument()
setArgument()
getArguments()
setArguments()
hasArgument()
offsetGet()
offsetSet()
offsetUnset()
offsetExists()
getIterator()
No public properties found
No constants found
No protected methods found
$subject
$arguments
N/A
No private methods found
$propagationStopped
N/A

Properties

$subject

$subject

$arguments

$arguments

$propagationStopped

$propagationStopped

Methods

isPropagationStopped()

isPropagationStopped() : bool

Is propagation stopped?

Returns

bool —

True if the Event is complete and no further listeners should be called. False to continue calling listeners.

stopPropagation()

stopPropagation() : void

Stops the propagation of the event to further event listeners.

If multiple event listeners are connected to the same event, no further event listener will be triggered once any trigger calls stopPropagation().

__construct()

__construct(mixed  $subject = null, array  $arguments = []) : mixed

Encapsulate an event with $subject and $args.

Parameters

mixed $subject

The subject of the event, usually an object or a callable

array $arguments

Arguments to store in the event

Returns

mixed —

getSubject()

getSubject() : mixed

Getter for subject property.

Returns

mixed —

getArgument()

getArgument(string  $key) : mixed

Get argument by key.

Parameters

string $key

Throws

\InvalidArgumentException

if key is not found

Returns

mixed —

setArgument()

setArgument(string  $key, mixed  $value) : $this

Add argument to event.

Parameters

string $key
mixed $value

Value

Returns

$this —

getArguments()

getArguments() : array

Getter for all arguments.

Returns

array —

setArguments()

setArguments(array  $args = []) : $this

Set args property.

Parameters

array $args

Returns

$this —

hasArgument()

hasArgument(string  $key) : bool

Has argument.

Parameters

string $key

Returns

bool —

offsetGet()

offsetGet(string  $key) : mixed

ArrayAccess for argument getter.

Parameters

string $key

Array key

Throws

\InvalidArgumentException

if key does not exist in $this->args

Returns

mixed —

offsetSet()

offsetSet(string  $key, mixed  $value) : void

ArrayAccess for argument setter.

Parameters

string $key

Array key to set

mixed $value

Value

offsetUnset()

offsetUnset(string  $key) : void

ArrayAccess for unset argument.

Parameters

string $key

Array key

offsetExists()

offsetExists(string  $key) : bool

ArrayAccess has argument.

Parameters

string $key

Array key

Returns

bool —

getIterator()

getIterator() : \ArrayIterator<string,mixed>

IteratorAggregate for iterating over the object like an array.

Returns

\ArrayIterator