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

Public Member Functions

 setOptions (PatternOptions $options)
 Set options.
 
 call ($callback, array $args=[])
 Call the specified callback or get the result from cache.
 
 __call ($function, array $args)
 function call handler
 
 generateKey ($callback, array $args=[])
 Generate a unique key in base of a key representing the callback part and a key representing the arguments part.
 
- Public Member Functions inherited from AbstractPattern
 setOptions (PatternOptions $options)
 Set pattern options.
 
 getOptions ()
 Get all pattern options.
 

Protected Member Functions

 generateCallbackKey ($callback, array $args)
 Generate a unique key in base of a key representing the callback part and a key representing the arguments part.
 
 generateArgumentsKey (array $args)
 Generate a unique key of the argument part.
 

Additional Inherited Members

- Protected Attributes inherited from AbstractPattern
 $options
 

Member Function Documentation

__call (   $function,
array  $args 
)

function call handler

Parameters
string$functionFunction name to call
array$argsFunction arguments
Returns
mixed
Exceptions
Exception\RuntimeException
\Exception
call (   $callback,
array  $args = [] 
)

Call the specified callback or get the result from cache.

Parameters
callable$callbackA valid callback
array$argsCallback arguments
Returns
mixed Result
Exceptions
Exception\RuntimeExceptionif invalid cached data
\Exception
generateArgumentsKey ( array  $args)
protected

Generate a unique key of the argument part.

Parameters
array$args
Exceptions
Exception\RuntimeException
Returns
string
generateCallbackKey (   $callback,
array  $args 
)
protected

Generate a unique key in base of a key representing the callback part and a key representing the arguments part.

Parameters
callable$callbackA valid callback
array$argsCallback arguments
Exceptions
Exception\RuntimeExceptionif callback not serializable
Exception\InvalidArgumentExceptionif invalid callback
Returns
string
generateKey (   $callback,
array  $args = [] 
)

Generate a unique key in base of a key representing the callback part and a key representing the arguments part.

Parameters
callable$callbackA valid callback
array$argsCallback arguments
Returns
string
Exceptions
Exception\RuntimeException
Exception\InvalidArgumentException
setOptions ( PatternOptions  $options)

Set options.

Parameters
PatternOptions$options
Returns
CallbackCache
Exceptions
Exception\InvalidArgumentExceptionif missing storage option

Implements PatternInterface.