spunQ_Callback Class Reference

Generic callback class that can hold parameters to the actual callbacks. More...

List of all members.

Public Member Functions

 __construct ($callback)
 Constructor.
 invoke ($additionalParameters=array())
 Invokes this callback.

Static Public Member Functions

static describe ($callback)
 Provides a string description for a callback.
static call ($callback, $parameters=array())
 Calls a generic callback function.

Protected Attributes

 $callback
 The actual callback to use.
 $parameters = array()
 Parameters to the callback.

Static Private Member Functions

static describeParameter ($parameter)
 Provides a human-readable description of an arbitrary value.


Detailed Description

Generic callback class that can hold parameters to the actual callbacks.

Makes use of the callback pseudo-type in PHP.

See also:
http://php.net/manual/en/language.pseudo-types.php#language.types.callback

Definition at line 8 of file Callback.class.php.


Constructor & Destructor Documentation

spunQ_Callback::__construct ( callback  ) 

Constructor.

Can accept any number of parameters. Any parameters beyond the first are passed to the callback function when it is invoked.

See also:
http://php.net/manual/en/language.pseudo-types.php#language.types.callback
Parameters:
$callback The actual callback to use.

Definition at line 90 of file Callback.class.php.


Member Function Documentation

static spunQ_Callback::call ( callback,
parameters = array() 
) [static]

Calls a generic callback function.

Will detect a spunQ_Callback function and invoke that or use call_user_func_array(), whichever is appropriate.

See also:
http://php.net/manual/en/language.pseudo-types.php#language.types.callback
Parameters:
$callback Either a callback pseudo-type or a spunQ_Callback object.
$parameters Parameters to the callback. These will be passed to invoke() if the $callback is an object.
Returns:
any Whatever the callback returns.

Definition at line 47 of file Callback.class.php.

static spunQ_Callback::describe ( callback  )  [static]

Provides a string description for a callback.

See also:
http://php.net/manual/en/language.pseudo-types.php#language.types.callback
Parameters:
$callback Either a callback pseudo-type or a spunQ_Callback object.
Returns:
string

Definition at line 17 of file Callback.class.php.

static spunQ_Callback::describeParameter ( parameter  )  [static, private]

Provides a human-readable description of an arbitrary value.

Parameters:
$parameter The parameter to provide a readable string for.
Returns:
string

Definition at line 59 of file Callback.class.php.

spunQ_Callback::invoke ( additionalParameters = array()  ) 

Invokes this callback.

Any parameters of type spunQ_Callback will be invoked before being passed to the callback function.

Parameters:
$additionalParameters More parameters that might replace already given parameters. The final set of parameters will be determined by adding this array to the $parameters array that was provided to the constructor (http://php.net/manual/en/language.operators.array.php). Any parameters of type spunQ_Callback will be invoke()d before the actual callback is made.
Returns:
any Whatever the callback returns.

Definition at line 109 of file Callback.class.php.


Member Data Documentation

spunQ_Callback::$callback [protected]

The actual callback to use.

See also:
http://php.net/manual/en/language.pseudo-types.php#language.types.callback callback

Definition at line 73 of file Callback.class.php.

spunQ_Callback::$parameters = array() [protected]

Parameters to the callback.

Any parameters of type spunQ_Callback will be invoked before being passed to the callback function. array<any>

Definition at line 81 of file Callback.class.php.


The documentation for this class was generated from the following file:

Generated on Fri Jul 1 11:12:38 2011 for spunQ3 by  doxygen 1.5.9