Class MvcEvent

Summary

Fully Qualified Name: Laminas\Mvc\MvcEvent
Extends: Event

Description

Methods

Name Description Defined By
__construct() Constructor Event
getApplication() Get application instance MvcEvent
getController() Get the currently registered controller name MvcEvent
getControllerClass() Get controller class MvcEvent
getError() Retrieve the error message, if any MvcEvent
getName() Get event name Event
getParam() Get an individual parameter Event
getParams() Get all parameters Event
getRequest() Get request MvcEvent
getResponse() Get response MvcEvent
getResult() Get result MvcEvent
getRouteMatch() Get route match MvcEvent
getRouter() Get router MvcEvent
getTarget() Get the event target Event
getViewModel() Get the view model MvcEvent
isError() Does the event represent an error response? MvcEvent
propagationIsStopped() Is propagation stopped? Event
setApplication() Set application instance MvcEvent
setController() Set controller name MvcEvent
setControllerClass() Set controller class MvcEvent
setError() Set the error message (indicating error in handling request) MvcEvent
setName() Set the event name Event
setParam() Set an individual parameter to a value Event
setParams() Set parameters Event
setRequest() Set request MvcEvent
setResponse() Set response MvcEvent
setResult() Set result MvcEvent
setRouteMatch() Set route match MvcEvent
setRouter() Set router MvcEvent
setTarget() Set the event target/context Event
setViewModel() Set the view model MvcEvent
stopPropagation() Stop further event propagation Event

Method Details

__construct()

Constructor

Accept a target and its parameters.

Parameter Name Type Description
$name string Event
$target string|object
$params array|\ArrayAccess

Returns:

getApplication()

Get application instance

Returns: \ApplicationInterface

getController()

Get the currently registered controller name

Returns: string

getControllerClass()

Get controller class

Returns: string

getError()

Retrieve the error message, if any

Returns: string

getName()

Get event name

Returns: string

getParam()

Get an individual parameter

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

Parameter Name Type Description
$name string|int
$default mixed

Returns: mixed

getParams()

Get all parameters

Returns: array|object|\ArrayAccess

getRequest()

Get request

Returns: \Request

getResponse()

Get response

Returns: \Response

getResult()

Get result

Returns: mixed

getRouteMatch()

Get route match

Returns: null|\RouteMatch

getRouter()

Get router

Returns: \RouteStackInterface

getTarget()

Get the event target

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

Returns: string|object

getViewModel()

Get the view model

Returns: \Model

isError()

Does the event represent an error response?

Returns: bool

propagationIsStopped()

Is propagation stopped?

Returns: bool

setApplication()

Set application instance

Parameter Name Type Description
$application \ApplicationInterface

Returns: \MvcEvent

setController()

Set controller name

Parameter Name Type Description
$name string

Returns: \MvcEvent

setControllerClass()

Set controller class

Parameter Name Type Description
$class string

Returns: \MvcEvent

setError()

Set the error message (indicating error in handling request)

Parameter Name Type Description
$message string

Returns: \MvcEvent

setName()

Set the event name

Parameter Name Type Description
$name string

Returns:

setParam()

Set an individual parameter to a value

Parameter Name Type Description
$name string|int
$value mixed

Returns:

setParams()

Set parameters

Overwrites parameters

Parameter Name Type Description
$params array|\ArrayAccess|object

Returns:

setRequest()

Set request

Parameter Name Type Description
$request \Request

Returns: \MvcEvent

setResponse()

Set response

Parameter Name Type Description
$response \Response

Returns: \MvcEvent

setResult()

Set result

Parameter Name Type Description
$result mixed

Returns: \MvcEvent

setRouteMatch()

Set route match

Parameter Name Type Description
$matches \RouteMatch

Returns: \MvcEvent

setRouter()

Set router

Parameter Name Type Description
$router \RouteStackInterface

Returns: \MvcEvent

setTarget()

Set the event target/context

Parameter Name Type Description
$target null|string|object

Returns:

setViewModel()

Set the view model

Parameter Name Type Description
$viewModel \Model

Returns: \MvcEvent

stopPropagation()

Stop further event propagation

Parameter Name Type Description
$flag bool

Returns:

Top