Event
in package
implements
EventInterface
Representation of an event
Encapsulates the target context and parameters passed, and provides some behavior for interacting with the event manager.
Interfaces, Classes, Traits and Enums
- EventInterface
- Representation of an event
Table of Contents
- $name : string
- $params : array<string|int, mixed>|ArrayAccess|object
- $stopPropagation : bool
- $target : string|object
- __construct() : mixed
- Constructor
- getName() : string
- Get event name
- getParam() : mixed
- Get an individual parameter
- getParams() : array<string|int, mixed>|object|ArrayAccess
- Get all parameters
- getTarget() : string|object
- Get the event target
- propagationIsStopped() : bool
- Is propagation stopped?
- setName() : void
- Set the event name
- setParam() : void
- Set an individual parameter to a value
- setParams() : void
- Set parameters
- setTarget() : void
- Set the event target/context
- stopPropagation() : void
- Stop further event propagation
Properties
$name
protected
string
$name
Event name
$params
protected
array<string|int, mixed>|ArrayAccess|object
$params
= []
The event parameters
$stopPropagation
protected
bool
$stopPropagation
= false
Whether or not to stop propagation
$target
protected
string|object
$target
The event target
Methods
__construct()
Constructor
public
__construct([string $name = null ][, string|object $target = null ][, array<string|int, mixed>|ArrayAccess $params = null ]) : mixed
Accept a target and its parameters.
Parameters
- $name : string = null
-
Event name
- $target : string|object = null
- $params : array<string|int, mixed>|ArrayAccess = null
Return values
mixed —getName()
Get event name
public
getName() : string
Return values
string —getParam()
Get an individual parameter
public
getParam(string|int $name[, mixed $default = null ]) : mixed
If the parameter does not exist, the $default value will be returned.
Parameters
- $name : string|int
- $default : mixed = null
Return values
mixed —getParams()
Get all parameters
public
getParams() : array<string|int, mixed>|object|ArrayAccess
Return values
array<string|int, mixed>|object|ArrayAccess —getTarget()
Get the event target
public
getTarget() : string|object
This may be either an object, or the name of a static method.
Return values
string|object —propagationIsStopped()
Is propagation stopped?
public
propagationIsStopped() : bool
Return values
bool —setName()
Set the event name
public
setName(string $name) : void
Parameters
- $name : string
Return values
void —setParam()
Set an individual parameter to a value
public
setParam(string|int $name, mixed $value) : void
Parameters
- $name : string|int
- $value : mixed
Return values
void —setParams()
Set parameters
public
setParams(array<string|int, mixed>|ArrayAccess|object $params) : void
Overwrites parameters
Parameters
- $params : array<string|int, mixed>|ArrayAccess|object
Tags
Return values
void —setTarget()
Set the event target/context
public
setTarget(null|string|object $target) : void
Parameters
- $target : null|string|object
Return values
void —stopPropagation()
Stop further event propagation
public
stopPropagation([bool $flag = true ]) : void
Parameters
- $flag : bool = true