CEC registry class.

Used to register chains and chain functions to invoke.

Following 3 types of CEC functions/callbacks are supported at the moment: - Callbacks, which should only be invoked. They don't return a value and have no break conditions, @see cApiCecHook::execute() - Callbacks, which should return a value and/or should modify a passed parameter,

see - Callbacks, which should be processed untill a defined break condition achieves,
see \global\cApiCecHook::executeWhileBreakCondition()
author Timo A. Hummel
author Murat Purc
package CONTENIDO Backend Classes
subpackage CEC

 Methods

Adds a chain function which is to invoke.

addChainFunction(string $sChainName, string $sFunctionName) : bool

Parameters

$sChainName

string

Chain name

$sFunctionName

string

Name of function/callback to invoke. Feasible values are: - "ClassName->methodName" to invoke a method of a ClassName instance. A instance of the clas will be created here. - "ClassName::methodName" to invoke a static method of ClassName. - "FunctionName" to invoke a function. NOTE: Necessary files must be manually included before or by defined autoloader.

Exceptions

\cInvalidArgumentException if the given chain is not registered or the given callback is not callable

Returns

boolTrue on success, otherwhise false

Checks if a chain function exists.

chainFunctionExists(string $sChainName, string $sFunctionName) : bool

Parameters

$sChainName

string

Chain name

$sFunctionName

string

Name of function to check

Returns

bool

Returns a instance of cApiCecRegistry

getInstance() : \cApiCecRegistry
Static

Returns the iterator for a desired chain.

getIterator(string $sChainName) : \cIterator
todo : cIterator should be replaced by ArrayIterator (@see http://www.php.net/spl) but ArrayIterator uses rewind() instead of reset()...

Parameters

$sChainName

string

Chain name

Returns

Returns list of registered chain names

getRegisteredChainNames() : array

Returns

array

Checks if a chain is registered or not.

isChainRegistered(string $sChainName) : bool

Parameters

$sChainName

string

Returns

bool

Registers a chain (adds the chain to the internal chain holder)

registerChain(string $sChainName) : void

Parameters

$sChainName

string

Removes a chain function.

removeChainFunction(string $sChainName, string $sFunctionName) 

Parameters

$sChainName

string

Chain name

$sFunctionName

string

Name of function to remove from chain.

Unregisters a chain

unregisterChain(string $sChainName) : void

Parameters

$sChainName

string

Exceptions

\cInvalidArgumentException if the given chain does not exist

Constructor

__construct() : void

Adds the chain to the internal chain holder

_addChain(string $sChainName, array $aParameters) : void

Parameters

$sChainName

string

Chain name

$aParameters

array

Chain parameter

Resets the chain iterator.

_resetIterator(string $sChainName) : void

Parameters

$sChainName

string

Prevent cloning

__clone() : void

 Properties

 

$_aChains : array
 

$_instance : \cApiCecRegistry