Public Member Functions | Static Public Member Functions | Public Attributes

Method Class Reference

List of all members.

Public Member Functions

 __construct ($class, $method)
 exists ()
 method_array ()
 __invoke ()

Static Public Member Functions

static create ($class, $method)
static dispatch ($method, $multiple_optional_args=null)
static dispatch_array ($method, $args=array())

Public Attributes

 $class
 $method

Detailed Description

Encapsulate a method as a value.

Definition at line 13 of file method.php.


Constructor & Destructor Documentation

Method::__construct ( class,
method 
)

Constructor

Parameters:
string $class The name of the class
string $method The method of the class to execute
Returns:
The method of the class

Definition at line 35 of file method.php.


Member Function Documentation

Method::__invoke (  ) 

Execute the representative method when this object is called as a function. Example: $fn = Method::create('Habari/Utils', 'debug'); $fn('foo'); // Calls Habari/Utilsdebug('foo');

This magic method should not be called directly

Returns:
mixed The return value of the function this Method object represents

Definition at line 103 of file method.php.

static Method::create ( class,
method 
) [static]
static Method::dispatch ( method,
multiple_optional_args = null 
) [static]

Dispatch a method, whether a filter or function

Parameters:
Callable|string $method The method to call
mixed $multiple_optional_args Multiple arguments to dispatch() should be passed as separate arguments
Returns:
bool|mixed The return value from the dispatched method

Definition at line 54 of file method.php.

Referenced by ControlStorage::field_load(), and ControlStorage::field_save().

static Method::dispatch_array ( method,
args = array() 
) [static]

Dispatch a method, whether a filter or function

Parameters:
Callable|string $method The method to call
array $args An array of arguments to be passed to the method
Returns:
bool|mixed The return value from the dispatched method

Definition at line 67 of file method.php.

Referenced by dispatch(), FormControl::do_success(), and FormControl::save().

Method::exists (  ) 

Determine if the method exists and can be called

Returns:
bool true if the method exists

Definition at line 44 of file method.php.

Method::method_array (  ) 

Get the array that represents this method

Returns:
callable An array that can be used as a function (O_o)

Definition at line 83 of file method.php.

Referenced by __invoke(), and exists().


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