class GenericEvent extends Event implements ArrayAccess, IteratorAggregate
Event encapsulation class.
Encapsulates events thus decoupling the observer from the subject they encapsulate.
protected | $subject | ||
protected | $arguments |
bool | isPropagationStopped() Returns whether further event listeners should be triggered. | from Event |
stopPropagation() Stops the propagation of the event to further event listeners. | from Event | |
__construct(mixed $subject = null, array $arguments = array()) Encapsulate an event with $subject and $args. | ||
mixed | getSubject() Getter for subject property. | |
mixed | getArgument(string $key) Get argument by key. | |
$this | setArgument(string $key, mixed $value) Add argument to event. | |
array | getArguments() Getter for all arguments. | |
$this | setArguments(array $args = array()) Set args property. | |
bool | hasArgument(string $key) Has argument. | |
mixed | offsetGet(string $key) ArrayAccess for argument getter. | |
offsetSet(string $key, mixed $value) ArrayAccess for argument setter. | ||
offsetUnset(string $key) ArrayAccess for unset argument. | ||
bool | offsetExists(string $key) ArrayAccess has argument. | |
ArrayIterator | getIterator() IteratorAggregate for iterating over the object like an array. |
Returns whether further event listeners should be triggered.
bool | Whether propagation was already stopped for this event |
Event::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().
Encapsulate an event with $subject and $args.
mixed | $subject | The subject of the event, usually an object or a callable |
array | $arguments | Arguments to store in the event |
Getter for subject property.
mixed | $subject The observer subject |
Get argument by key.
string | $key | Key |
mixed | Contents of array key |
InvalidArgumentException | if key is not found |
Add argument to event.
string | $key | Argument name |
mixed | $value | Value |
$this |
Getter for all arguments.
array |
Set args property.
array | $args | Arguments |
$this |
Has argument.
string | $key | Key of arguments array |
bool |
ArrayAccess for argument getter.
string | $key | Array key |
mixed |
InvalidArgumentException | if key does not exist in $this->args |
ArrayAccess for argument setter.
string | $key | Array key to set |
mixed | $value | Value |
ArrayAccess for unset argument.
string | $key | Array key |
ArrayAccess has argument.
string | $key | Array key |
bool |
IteratorAggregate for iterating over the object like an array.
ArrayIterator |
© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/EventDispatcher/GenericEvent.html