XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
|
Manager for delegates. More...
Public Member Functions | |
__construct () | |
Constructor. | |
register ( $name, &$delegate) | |
Adds $delegate as Delegate to the list of this manager. | |
add (string $name, $callback, $param3=null, $param4=null) | |
Connects functions to the delegate that have the specified name. | |
delete (string $name, $delcallback) | |
Disconnects a function from the delegate that have the specified name. | |
reset (string $name) | |
Resets all functions off the delegate that have the specified name. | |
isEmpty (string $name) | |
Gets a value indicating whether the specified delegate has callback functions. | |
getDelegates () | |
Data Fields | |
$_mCallbacks = [] | |
Complex Array. | |
$_mCallbackParameters = [] | |
Complex Array. | |
$_mDelegates = [] | |
Map Array - std::map<string, XCube_Delegate*> | |
Manager for delegates.
This is the agent of un-registered delegate objects. Usually, connected functions can't be added to un-registered delegates. When destination delegates are not yet registered, this handler retains these functions and settings until the destination delegate is registered. In other words, this class performs lazy delegate registration.
Definition at line 388 of file XCube_Delegate.class.php.
__construct | ( | ) |
Constructor.
Definition at line 411 of file XCube_Delegate.class.php.
add | ( | string | $name, |
$callback, | |||
$param3 = null, | |||
$param4 = null ) |
Connects functions to the delegate that have the specified name.
string | $name | - Registration name. |
$callback | ||
null | $param3 | |
null | $param4 |
If there are no delegates with the specified name, this handler assigns the parameters to member properties. Then, when the delegate with the specified name is registered, this handler will set these parameters to the delegate.
Definition at line 464 of file XCube_Delegate.class.php.
delete | ( | string | $name, |
$delcallback ) |
Disconnects a function from the delegate that have the specified name.
string | $name | - Registration name |
$delcallback |
Definition at line 483 of file XCube_Delegate.class.php.
getDelegates | ( | ) |
Definition at line 538 of file XCube_Delegate.class.php.
isEmpty | ( | string | $name | ) |
Gets a value indicating whether the specified delegate has callback functions.
string | $name | string - Registration name. |
Definition at line 526 of file XCube_Delegate.class.php.
register | ( | $name, | |
& | $delegate ) |
Adds $delegate as Delegate to the list of this manager.
string | $name | - Registration name. |
XCube_Delegate | $delegate | - Delegate object which will be registered. |
If some functions that want to connect to $delegate, have not yet been assigned, this object calls add() of $delegate with their parameters.
Usually this member function isn't used as Cube's API by developers. In many cases, XCube_Delegate\register() calls this.
Definition at line 429 of file XCube_Delegate.class.php.
reset | ( | string | $name | ) |
Resets all functions off the delegate that have the specified name.
string | $name | - Registration name that will be reset. |
Definition at line 507 of file XCube_Delegate.class.php.
$_mCallbackParameters = [] |
Complex Array.
Definition at line 399 of file XCube_Delegate.class.php.
$_mCallbacks = [] |
Complex Array.
Definition at line 393 of file XCube_Delegate.class.php.
$_mDelegates = [] |
Map Array - std::map<string, XCube_Delegate*>
Definition at line 405 of file XCube_Delegate.class.php.