Representation of an event

Encapsulates the target context and parameters passed, and provides some behavior for interacting with the event manager.

category Zend
package Zend_EventManager

 Methods

Constructor

__construct(string $name, string | object $target, array | \ArrayAccess $params) 

Accept a target and its parameters.

Parameters

$name

string

Event name

$target

stringobject

$params

array\ArrayAccess

Get event name

getName() : string

Returns

string

Get an individual parameter

getParam(string | int $name, mixed $default) : mixed

If the parameter does not exist, the $default value will be returned.

Parameters

$name

stringint

$default

mixed

Returns

mixed

Get all parameters

getParams() : array | object | \ArrayAccess

Returns

arrayobject\ArrayAccess

Get the event target

getTarget() : string | object

This may be either an object, or the name of a static method.

Returns

stringobject

Is propagation stopped?

propagationIsStopped() : bool

Returns

bool

Set the event name

setName(string $name) : \Zend\EventManager\Event

Parameters

$name

string

Returns

Set an individual parameter to a value

setParam(string | int $name, mixed $value) : \Zend\EventManager\Event

Parameters

$name

stringint

$value

mixed

Returns

Set parameters

setParams(array | \ArrayAccess | object $params) : \Zend\EventManager\Event

Overwrites parameters

Parameters

$params

array\ArrayAccessobject

Exceptions

\Zend\EventManager\Exception\InvalidArgumentException

Returns

Set the event target/context

setTarget(null | string | object $target) : \Zend\EventManager\Event

Parameters

$target

nullstringobject

Returns

Stop further event propagation

stopPropagation(bool $flag) : void

Parameters

$flag

bool

 Properties

 

<p>Event name</p>

$name : string

 

<p>The event parameters</p>

$params : array | \ArrayAccess | object

 

<p>Whether or not to stop propagation</p>

$stopPropagation : bool

 

<p>The event target</p>

$target : string | object