FileAccess Orion

Event 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
$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
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
setStorage()  : Event
Alias of setTarget
setTarget()  : Event
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, StorageInterface $storage, ArrayObject $params) : mixed

Accept a storage adapter and its parameters.

Parameters
$name : string

Event name

$storage : StorageInterface
$params : ArrayObject
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
throws
InvalidArgumentException
Return values
void —

stopPropagation()

Stop further event propagation

public stopPropagation([bool $flag = true ]) : void
Parameters
$flag : bool = true
Return values
void —

Search results