\Symfony\Component\EventDispatcherGenericEvent

Event encapsulation class.

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

Summary

Methods
Properties
Constants
isPropagationStopped()
stopPropagation()
setDispatcher()
getDispatcher()
getName()
setName()
__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
$dispatcher
$name
N/A

Properties

$subject

$subject : mixed

Event subject.

Type

mixed — usually object or callable

$arguments

$arguments : array

Array of arguments.

Type

array

$propagationStopped

$propagationStopped : boolean

Type

boolean — Whether no further event listeners should be triggered

$name

$name : string

Type

string — This event's name

Methods

isPropagationStopped()

isPropagationStopped() : boolean

Returns whether further event listeners should be triggered.

Returns

boolean —

Whether propagation was already stopped for this event.

stopPropagation()

stopPropagation() 

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().

getName()

getName() : string

Gets the event's name.

Returns

string

setName()

setName(string  $name) 

Sets the event's name property.

Parameters

string $name

The event name.

__construct()

__construct(mixed  $subject = null, array  $arguments = array()) 

Encapsulate an event with $subject and $args.

Parameters

mixed $subject

The subject of the event, usually an object.

array $arguments

Arguments to store in the event.

getSubject()

getSubject() : mixed

Getter for subject property.

Returns

mixed —

$subject The observer subject.

getArgument()

getArgument(string  $key) : mixed

Get argument by key.

Parameters

string $key

Key.

Throws

\InvalidArgumentException

If key is not found.

Returns

mixed —

Contents of array key.

setArgument()

setArgument(string  $key, mixed  $value) : \Symfony\Component\EventDispatcher\GenericEvent

Add argument to event.

Parameters

string $key

Argument name.

mixed $value

Value.

Returns

\Symfony\Component\EventDispatcher\GenericEvent

getArguments()

getArguments() : array

Getter for all arguments.

Returns

array

hasArgument()

hasArgument(string  $key) : boolean

Has argument.

Parameters

string $key

Key of arguments array.

Returns

boolean

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) 

ArrayAccess for argument setter.

Parameters

string $key

Array key to set.

mixed $value

Value.

offsetUnset()

offsetUnset(string  $key) 

ArrayAccess for unset argument.

Parameters

string $key

Array key.

offsetExists()

offsetExists(string  $key) : boolean

ArrayAccess has argument.

Parameters

string $key

Array key.

Returns

boolean

getIterator()

getIterator() : \ArrayIterator

IteratorAggregate for iterating over the object like an array.

Returns

\ArrayIterator