PHP Class PAGI\Node\NodeController

Author: Marcelo Gornstein ([email protected])
Show file Open project: marcelog/pagi Class Usage Examples

Protected Properties

Property Type Description
$client PAGI\Client\IClient The PAGI client in use.
$logger PAGI\Logger\Asterisk\IAsteriskLogger Asterisk logger instance to use.
$nodeResults NodeActionCommand[] All registered node results.
$nodes Node[] All registered nodes.

Public Methods

Method Description
jumpTo ( string $name ) : void Runs a node and process the result.
register ( string $name ) : Node Registers a new node in the application. Returns the created node.
registerResult ( string $name ) : NodeActionCommand Registers a new node result to be taken into account when the given node is ran.
setAgiClient ( PAGI\Client\IClient $client ) : NodeController Sets the pagi client to use by this node.
setName ( string $name ) : Node Gives a name for this node.

Protected Methods

Method Description
logDebug ( string $msg ) : void Used internally to log debug messages
processNodeResult ( Node $node ) : string | false Process the result of the given node. Returns false if no other nodes should be run, or a string with the next node name.

Method Details

jumpTo() public method

Runs a node and process the result.
public jumpTo ( string $name ) : void
$name string Node to run.
return void

logDebug() protected method

Used internally to log debug messages
protected logDebug ( string $msg ) : void
$msg string
return void

processNodeResult() protected method

Process the result of the given node. Returns false if no other nodes should be run, or a string with the next node name.
protected processNodeResult ( Node $node ) : string | false
$node Node Node that was run.
return string | false

register() public method

Registers a new node in the application. Returns the created node.
public register ( string $name ) : Node
$name string The node to be registered
return Node

registerResult() public method

Registers a new node result to be taken into account when the given node is ran.
public registerResult ( string $name ) : NodeActionCommand
$name string
return NodeActionCommand

setAgiClient() public method

Sets the pagi client to use by this node.
public setAgiClient ( PAGI\Client\IClient $client ) : NodeController
$client PAGI\Client\IClient
return NodeController

setName() public method

Gives a name for this node.
public setName ( string $name ) : Node
$name string
return Node

Property Details

$client protected property

The PAGI client in use.
protected IClient,PAGI\Client $client
return PAGI\Client\IClient

$logger protected property

Asterisk logger instance to use.
protected IAsteriskLogger,PAGI\Logger\Asterisk $logger
return PAGI\Logger\Asterisk\IAsteriskLogger

$nodeResults protected property

All registered node results.
protected NodeActionCommand[],PAGI\Node $nodeResults
return NodeActionCommand[]

$nodes protected property

All registered nodes.
protected Node[],PAGI\Node $nodes
return Node[]