GenericEvent (Component\EventDispatcher)
Symfony\Component\EventDispatcher\GenericEvent
class GenericEvent extends Event implements ArrayAccess, IteratorAggregate
Event encapsulation class.
Encapsulates events thus decoupling the observer from the subject they encapsulate.
Methods
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 | |
setDispatcher(EventDispatcherInterface $dispatcher) Stores the EventDispatcher that dispatches this Event. | from Event | |
EventDispatcherInterface | getDispatcher() Returns the EventDispatcher that dispatches this Event. | from Event |
string | getName() Gets the event's name. | from Event |
setName(string $name) Sets the event's name property. | 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. | |
GenericEvent | setArgument(string $key, mixed $value) Add argument to event. | |
array | getArguments() Getter for all arguments. | |
GenericEvent | 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. |
Details
public bool isPropagationStopped()
Returns whether further event listeners should be triggered.
public 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().
public setDispatcher(EventDispatcherInterface $dispatcher)
Stores the EventDispatcher that dispatches this Event.
public EventDispatcherInterface getDispatcher()
Returns the EventDispatcher that dispatches this Event.
public string getName()
Gets the event's name.
public setName(string $name)
Sets the event's name property.
public __construct(mixed $subject = null, array $arguments = array())
Encapsulate an event with $subject and $args.
public mixed getSubject()
Getter for subject property.
public mixed getArgument(string $key)
Get argument by key.
public GenericEvent setArgument(string $key, mixed $value)
Add argument to event.
public array getArguments()
Getter for all arguments.
public GenericEvent setArguments(array $args = array())
Set args property.
public bool hasArgument(string $key)
Has argument.
public mixed offsetGet(string $key)
ArrayAccess for argument getter.
public offsetSet(string $key, mixed $value)
ArrayAccess for argument setter.
public offsetUnset(string $key)
ArrayAccess for unset argument.
public bool offsetExists(string $key)
ArrayAccess has argument.
public ArrayIterator getIterator()
IteratorAggregate for iterating over the object like an array.
© 2004–2016 Fabien Potencier
Licensed under the MIT License.
http://api.symfony.com/3.0/Symfony/Component/EventDispatcher/GenericEvent.html