Zend Framework  3.0
Public Member Functions | Protected Attributes | List of all members
Event Class Reference

Representation of an event. More...

Public Member Functions

 __construct ($name=null, $target=null, $params=null)
 Constructor.
 
 getName ()
 Get event name.
 
 getTarget ()
 Get the event target.
 
 setParams ($params)
 Set parameters.
 
 getParams ()
 Get all parameters.
 
 getParam ($name, $default=null)
 Get an individual parameter.
 
 setName ($name)
 Set the event name.
 
 setTarget ($target)
 Set the event target/context.
 
 setParam ($name, $value)
 Set an individual parameter to a value.
 
 stopPropagation ($flag=true)
 Stop further event propagation.
 
 propagationIsStopped ()
 Is propagation stopped?
 

Protected Attributes

 $name
 
 $target
 
 $params = []
 
 $stopPropagation = false
 

Detailed Description

Representation of an event.

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

Constructor & Destructor Documentation

__construct (   $name = null,
  $target = null,
  $params = null 
)

Constructor.

Accept a target and its parameters.

Parameters
string$nameEvent name
string | object$target
array | ArrayAccess$params

Member Function Documentation

getName ( )

Get event name.

Returns
string

Implements EventInterface.

getParam (   $name,
  $default = null 
)

Get an individual parameter.

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

Parameters
string | int$name
mixed$default
Returns
mixed

Implements EventInterface.

getParams ( )

Get all parameters.

Returns
array|object|ArrayAccess

Implements EventInterface.

getTarget ( )

Get the event target.

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

Returns
string|object

Implements EventInterface.

propagationIsStopped ( )

Is propagation stopped?

Returns
bool

Implements EventInterface.

setName (   $name)

Set the event name.

Parameters
string$name

Implements EventInterface.

setParam (   $name,
  $value 
)

Set an individual parameter to a value.

Parameters
string | int$name
mixed$value

Implements EventInterface.

setParams (   $params)

Set parameters.

Overwrites parameters

Parameters
array | ArrayAccess | object$params
Exceptions
Exception\InvalidArgumentException

Implements EventInterface.

setTarget (   $target)

Set the event target/context.

Parameters
null | string | object$target

Implements EventInterface.

stopPropagation (   $flag = true)

Stop further event propagation.

Parameters
bool$flag

Implements EventInterface.

Member Data Documentation

$name
protected
$params = []
protected
$stopPropagation = false
protected
$target
protected