PostEvent
extends Event
in package
Representation of an event
Encapsulates the target context and parameters passed, and provides some behavior for interacting with the event manager.
Table of Contents
- $name : string
- $params : array<string|int, mixed>|ArrayAccess|object
- $result : mixed
- The result/return value
- $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
- getResult() : mixed
- Get the result/return value
- getStorage() : StorageInterface
- Alias of getTarget
- 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
- setResult() : PostEvent
- Set the result/return value
- setStorage() : Event
- Alias of setTarget
- 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
$result
The result/return value
protected
mixed
$result
$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, StorageInterface $storage, ArrayObject $params, mixed &$result) : mixed
Accept a target and its parameters.
Parameters
- $name : string
- $storage : StorageInterface
- $params : ArrayObject
- $result : mixed
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 —getResult()
Get the result/return value
public
& getResult() : mixed
Return values
mixed —getStorage()
Alias of getTarget
public
getStorage() : StorageInterface
Return values
StorageInterface —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 —setResult()
Set the result/return value
public
setResult(mixed &$value) : PostEvent
Parameters
- $value : mixed
Return values
PostEvent —setStorage()
Alias of setTarget
public
setStorage(StorageInterface $storage) : Event
Parameters
- $storage : StorageInterface
Tags
Return values
Event —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