Representation of an event

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

package Default
inherited_from \Zend\EventManager\Event

 Methods

Constructor

__construct(string $name = null, string|object $target = null, array|\ArrayAccess $params = null
Inherited

Accept a target and its parameters.

Parameters

$name

string

Event name

$target

stringobject

$params

array\ArrayAccess

Retrieve the view model

getModel() : null | \Zend\View\Model\ModelInterface

Returns

null\Zend\View\Model\ModelInterface

Get event name

getName() : string
Inherited
inherited_from \Zend\EventManager\EventInterface::getName()

Returns

string

Get event parameter

getParam(string $name, mixed $default = null) : mixed

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

inherited_from \Zend\EventManager\Event::getParam()

Parameters

$name

string

$default

mixed

Returns

mixed

Get an individual parameter

getParam(string|integer $name, mixed $default = null) : mixed
Inherited

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

inherited_from \Zend\EventManager\EventInterface::getParam()

Parameters

$name

stringinteger

$default

mixed

Returns

mixed

Get all event parameters

getParams() : array | \ArrayAccess
inherited_from \Zend\EventManager\Event::getParams()

Returns

array\ArrayAccess

Get all parameters

getParams() : array | object | \ArrayAccess
Inherited
inherited_from \Zend\EventManager\EventInterface::getParams()

Returns

arrayobject\ArrayAccess

Get value for renderer

getRenderer() : null | \Zend\View\Renderer\RendererInterface

Returns

null\Zend\View\Renderer\RendererInterface

Retrieve the MVC request object

getRequest() : null | \Zend\Stdlib\RequestInterface

Returns

null\Zend\Stdlib\RequestInterface

Retrieve the MVC response object

getResponse() : null | \Zend\Stdlib\ResponseInterface

Returns

null\Zend\Stdlib\ResponseInterface

Retrieve the result of rendering

getResult() : mixed

Returns

mixed

Get the event target

getTarget() : string | object
Inherited

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

inherited_from \Zend\EventManager\EventInterface::getTarget()

Returns

stringobject

Is propagation stopped?

propagationIsStopped() : boolean
Inherited
inherited_from \Zend\EventManager\EventInterface::propagationIsStopped()

Returns

boolean

Set the view model

setModel(\Zend\View\Model\ModelInterface $model) : \Zend\View\ViewEvent

Parameters

$model

\Zend\View\Model\ModelInterface

Returns

\Zend\View\ViewEvent

Set the event name

setName(string $name) : \Zend\EventManager\Event
Inherited
inherited_from \Zend\EventManager\EventInterface::setName()

Parameters

$name

string

Returns

\Zend\EventManager\Event

Set an individual event parameter

setParam(string $name, mixed $value) : \Zend\View\ViewEvent
inherited_from \Zend\EventManager\Event::setParam()

Parameters

$name

string

$value

mixed

Returns

\Zend\View\ViewEvent

Set an individual parameter to a value

setParam(string|integer $name, mixed $value) : \Zend\EventManager\Event
Inherited
inherited_from \Zend\EventManager\EventInterface::setParam()

Parameters

$name

stringinteger

$value

mixed

Returns

\Zend\EventManager\Event

Set event parameters

setParams(array|object|\ArrayAccess $params) : \Zend\View\ViewEvent

Overwrites parameters

inherited_from \Zend\EventManager\Event::setParams()

Parameters

$params

arrayobject\ArrayAccess

Returns

\Zend\View\ViewEvent

Set parameters

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

Overwrites parameters

inherited_from \Zend\EventManager\EventInterface::setParams()

Parameters

$params

array\ArrayAccessobject

Exceptions

\Zend\EventManager\Exception\InvalidArgumentException

Returns

\Zend\EventManager\Event

Set value for renderer

setRenderer(\Zend\View\Renderer\RendererInterface $renderer) : \Zend\View\ViewEvent

Parameters

$renderer

\Zend\View\Renderer\RendererInterface

Returns

\Zend\View\ViewEvent

Set the MVC request object

setRequest(\Zend\Stdlib\RequestInterface $request) : \Zend\View\ViewEvent

Parameters

$request

\Zend\Stdlib\RequestInterface

Returns

\Zend\View\ViewEvent

Set the MVC response object

setResponse(\Zend\Stdlib\ResponseInterface $response) : \Zend\View\ViewEvent

Parameters

$response

\Zend\Stdlib\ResponseInterface

Returns

\Zend\View\ViewEvent

Set result of rendering

setResult(mixed $result) : \Zend\View\ViewEvent

Parameters

$result

mixed

Returns

\Zend\View\ViewEvent

Set the event target/context

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

Parameters

$target

nullstringobject

Returns

\Zend\EventManager\Event

Stop further event propagation

stopPropagation(boolean $flag = true) : void
Inherited
inherited_from \Zend\EventManager\EventInterface::stopPropagation()

Parameters

$flag

boolean

 Properties

 

$model

$model : null | \Zend\View\Model\ModelInterface

Default

 

Event name

$name : string

Default

 

The event parameters

$params : array | \ArrayAccess | object

Default

array()
 

$renderer

$renderer : \Zend\View\Renderer\RendererInterface

Default

 

$request

$request : null | \Zend\Stdlib\RequestInterface

Default

 

$response

$response : null | \Zend\Stdlib\ResponseInterface

Default

 

$result

$result : mixed

Default

 

Whether or not to stop propagation

$stopPropagation : boolean

Default

false
 

The event target

$target : string | object

Default

 Constants

 

EVENT_RENDERER

EVENT_RENDERER = 'renderer' 
 

EVENT_RENDERER_POST

EVENT_RENDERER_POST = 'renderer.post' 
 

EVENT_RESPONSE

EVENT_RESPONSE = 'response'