Event
in package
Event is the base class for classes containing event data.
This class contains no event data. It is used by events that do not pass state information to an event handler when an event is raised.
You can call the method stopPropagation() to abort the execution of further listeners in your event listener.
Tags
Table of Contents
Properties
- $dispatcher : EventDispatcher
- $name : string
- $propagationStopped : bool
Methods
- getDispatcher() : EventDispatcherInterface
- Returns the EventDispatcher that dispatches this Event.
- getName() : string
- Gets the event's name.
- isPropagationStopped() : bool
- Returns whether further event listeners should be triggered.
- setDispatcher() : mixed
- Stores the EventDispatcher that dispatches this Event.
- setName() : mixed
- Sets the event's name property.
- stopPropagation() : mixed
- Stops the propagation of the event to further event listeners.
Properties
$dispatcher
private
EventDispatcher
$dispatcher
Dispatcher that dispatched this event
$name
private
string
$name
This event's name
$propagationStopped
private
bool
$propagationStopped
= false
Whether no further event listeners should be triggered
Methods
getDispatcher()
Returns the EventDispatcher that dispatches this Event.
public
getDispatcher() : EventDispatcherInterface
since version 2.4, to be removed in 3.0. The event dispatcher is passed to the listener call.
Return values
EventDispatcherInterfacegetName()
Gets the event's name.
public
getName() : string
since version 2.4, to be removed in 3.0. The event name is passed to the listener call.
Return values
stringisPropagationStopped()
Returns whether further event listeners should be triggered.
public
isPropagationStopped() : bool
Tags
Return values
bool —Whether propagation was already stopped for this event.
setDispatcher()
Stores the EventDispatcher that dispatches this Event.
public
setDispatcher(EventDispatcherInterface $dispatcher) : mixed
since version 2.4, to be removed in 3.0. The event dispatcher is passed to the listener call.
Parameters
- $dispatcher : EventDispatcherInterface
setName()
Sets the event's name property.
public
setName(string $name) : mixed
since version 2.4, to be removed in 3.0. The event name is passed to the listener call.
Parameters
- $name : string
-
The event name.
stopPropagation()
Stops the propagation of the event to further event listeners.
public
stopPropagation() : mixed
If multiple event listeners are connected to the same event, no further event listener will be triggered once any trigger calls stopPropagation().