Documentation

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
author

Guilherme Blanco guilhermeblanco@hotmail.com

author

Jonathan Wage jonwage@gmail.com

author

Roman Borschel roman@code-factory.org

author

Bernhard Schussek bschussek@gmail.com

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

$name

private string $name

This event's name

$propagationStopped

private bool $propagationStopped = false

Whether no further event listeners should be triggered

Methods

getName()

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
string

isPropagationStopped()

Returns whether further event listeners should be triggered.

public isPropagationStopped() : bool
Tags
see
Event::stopPropagation()
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().


        
On this page

Search results