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_Mvc

 Methods

Constructor

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

Accept a target and its parameters.

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

Parameters

$name

string

Event name

$target

stringobject

$params

array\ArrayAccess

Get application instance

getApplication() : \Zend\Mvc\ApplicationInterface

Get the currently registered controller name

getController() : string

Returns

string

Get controller class

getControllerClass() : string

Returns

string

Retrieve the error message, if any

getError() : string

Returns

string

Get event name

getName() : string
Inherited

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

Returns

string

Get an individual parameter

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

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

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

Parameters

$name

stringint

$default

mixed

Returns

mixed

Get all parameters

getParams() : array | object | \ArrayAccess
Inherited

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

Returns

arrayobject\ArrayAccess

Get request

getRequest() : \Zend\Stdlib\RequestInterface

Get response

getResponse() : \Zend\Stdlib\ResponseInterface

Get result

getResult() : mixed

Returns

mixed

Get route match

getRouteMatch() : \Zend\Mvc\Router\RouteMatch

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\Event::getTarget()

Returns

stringobject

Get the view model

getViewModel() : \Zend\View\Model\ModelInterface

Does the event represent an error response?

isError() : bool

Returns

bool

Is propagation stopped?

propagationIsStopped() : bool
Inherited

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

Returns

bool

Set application instance

setApplication(\Zend\Mvc\ApplicationInterface $application) : \Zend\Mvc\MvcEvent

Parameters

Returns

Set controller name

setController(string $name) : \Zend\Mvc\MvcEvent

Parameters

$name

string

Returns

Set controller class

setControllerClass(string $class) : \Zend\Mvc\MvcEvent

Parameters

$class

string

Returns

Set the error message (indicating error in handling request)

setError(string $message) : \Zend\Mvc\MvcEvent

Parameters

$message

string

Returns

Set the event name

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

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

Parameters

$name

string

Returns

Set an individual parameter to a value

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

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

Parameters

$name

stringint

$value

mixed

Returns

Set parameters

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

Overwrites parameters

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

Parameters

$params

array\ArrayAccessobject

Exceptions

\Zend\EventManager\Exception\InvalidArgumentException

Returns

Set request

setRequest(\Zend\Stdlib\RequestInterface $request) : \Zend\Mvc\MvcEvent

Set response

setResponse(\Zend\Stdlib\ResponseInterface $response) : \Zend\Mvc\MvcEvent

Parameters

Returns

Set result

setResult(mixed $result) : \Zend\Mvc\MvcEvent

Parameters

$result

mixed

Returns

Set route match

setRouteMatch(\Zend\Mvc\Router\RouteMatch $matches) : \Zend\Mvc\MvcEvent

Parameters

Returns

Set router

setRouter(\Zend\Mvc\Router\RouteStackInterface $router) : \Zend\Mvc\MvcEvent

Set the event target/context

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

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

Parameters

$target

nullstringobject

Returns

Set the view model

setViewModel(\Zend\View\Model\ModelInterface $viewModel) : \Zend\Mvc\MvcEvent

Parameters

Returns

Stop further event propagation

stopPropagation(bool $flag) : void
Inherited

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

Parameters

$flag

bool

 Properties

 

$application

$application 

 

<p>Event name</p>

$name : string
Inherited

inherited_from \Zend\EventManager\Event::$$name
 

<p>The event parameters</p>

$params : array | \ArrayAccess | object
Inherited

inherited_from \Zend\EventManager\Event::$$params
 

$request

$request : \Zend\Stdlib\RequestInterface

 

$response

$response : \Zend\Stdlib\ResponseInterface

 

$result

$result : mixed

 

$routeMatch

$routeMatch : \Zend\Mvc\Router\RouteMatch

   

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

$stopPropagation : bool
Inherited

inherited_from \Zend\EventManager\Event::$$stopPropagation
 

<p>The event target</p>

$target : string | object
Inherited

inherited_from \Zend\EventManager\Event::$$target
 

$viewModel

$viewModel : \Zend\View\Model\ModelInterface

 Constants

 

EVENT_BOOTSTRAP

EVENT_BOOTSTRAP 

 

EVENT_DISPATCH

EVENT_DISPATCH 

 

EVENT_DISPATCH_ERROR

EVENT_DISPATCH_ERROR 

 

EVENT_FINISH

EVENT_FINISH 

 

EVENT_RENDER

EVENT_RENDER 

 

EVENT_ROUTE

EVENT_ROUTE