Zend Framework  2.4
Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
CallbackHandler Class Reference

CallbackHandler. More...

Public Member Functions

 __construct ($callback, array $metadata=array())
 Constructor.
 
 getCallback ()
 Retrieve registered callback.
 
 call (array $args=array())
 Invoke handler.
 
 __invoke ()
 Invoke as functor.
 
 getMetadata ()
 Get all callback metadata.
 
 getMetadatum ($name)
 Retrieve a single metadatum.
 

Protected Member Functions

 registerCallback ($callback)
 Registers the callback provided in the constructor.
 
 validateStringCallbackFor54 ($callback)
 Validate a static method call.
 

Protected Attributes

 $callback
 
 $metadata
 

Static Protected Attributes

static $isPhp54
 

Detailed Description

CallbackHandler.

A handler for an event, event, filterchain, etc. Abstracts PHP callbacks, primarily to allow for lazy-loading and ensuring availability of default arguments (currying).

Constructor & Destructor Documentation

__construct (   $callback,
array  $metadata = array() 
)

Constructor.

Parameters
string | array | object | callable$callbackPHP callback
array$metadataCallback metadata

Member Function Documentation

__invoke ( )

Invoke as functor.

Returns
mixed
call ( array  $args = array())

Invoke handler.

Parameters
array$argsArguments to pass to callback
Returns
mixed
getCallback ( )

Retrieve registered callback.

Returns
callable
getMetadata ( )

Get all callback metadata.

Returns
array
getMetadatum (   $name)

Retrieve a single metadatum.

Parameters
string$name
Returns
mixed
registerCallback (   $callback)
protected

Registers the callback provided in the constructor.

Parameters
callable$callback
Exceptions
Exception\InvalidCallbackException
Returns
void
validateStringCallbackFor54 (   $callback)
protected

Validate a static method call.

Validates that a static method call in PHP 5.4 will actually work

Parameters
string$callback
Returns
true|array
Exceptions
Exception\InvalidCallbackExceptionif invalid

Member Data Documentation

$callback
protected
$isPhp54
staticprotected
$metadata
protected