PHP Класс PAGI\Node\NodeActionCommand

Автор: Marcelo Gornstein ([email protected])
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$action
$data
$nodeName
$result

Открытые методы

Метод Описание
appliesTo ( Node $node ) : boolean True if the given node (already executed) matches with the specs defined in this action command.
execute ( Closure $callback ) : NodeActionCommand As an action, execute the given callback.
getActionData ( ) : array Returns the action information.
hangup ( integer $cause ) : NodeActionCommand As an action, hangup the call with the given cause.
isActionExecute ( ) : boolean True if a callback should be executed as an action.
isActionHangup ( ) : boolean True if hangup should be done as an action.
isActionJumpTo ( ) : boolean True if we have to jump to another node as an action.
jumpAfterEval ( Closure $callback ) : NodeActionCommand As an action, evaluate the given callback and jump to the node (name) returned by it.
jumpTo ( string $name ) : NodeActionCommand As an action, jump to the given node (name).
onCancel ( ) : NodeActionCommand Do the configured action when the node has been cancelled.
onComplete ( ) : NodeActionCommand Do the configured action when the node has completed successfully.
onMaxAttemptsReached ( ) : NodeActionCommand Do the configured action when the node finished without a valid input from the user.
whenNode ( string $name ) : NodeActionCommand Sets the controlled node.
withInput ( string $input ) : NodeActionCommand Do the configured action when the node has completed successfully with this specific input from the user. Very useful for menues.

Описание методов

appliesTo() публичный Метод

True if the given node (already executed) matches with the specs defined in this action command.
public appliesTo ( Node $node ) : boolean
$node Node
Результат boolean

execute() публичный Метод

As an action, execute the given callback.
public execute ( Closure $callback ) : NodeActionCommand
$callback Closure
Результат NodeActionCommand

getActionData() публичный Метод

Returns the action information.
public getActionData ( ) : array
Результат array

hangup() публичный Метод

As an action, hangup the call with the given cause.
public hangup ( integer $cause ) : NodeActionCommand
$cause integer
Результат NodeActionCommand

isActionExecute() публичный Метод

True if a callback should be executed as an action.
public isActionExecute ( ) : boolean
Результат boolean

isActionHangup() публичный Метод

True if hangup should be done as an action.
public isActionHangup ( ) : boolean
Результат boolean

isActionJumpTo() публичный Метод

True if we have to jump to another node as an action.
public isActionJumpTo ( ) : boolean
Результат boolean

jumpAfterEval() публичный Метод

As an action, evaluate the given callback and jump to the node (name) returned by it.
public jumpAfterEval ( Closure $callback ) : NodeActionCommand
$callback Closure A string MUST be returned that is the name of the node to jump to.
Результат NodeActionCommand

jumpTo() публичный Метод

As an action, jump to the given node (name).
public jumpTo ( string $name ) : NodeActionCommand
$name string The node name where to jump to.
Результат NodeActionCommand

onCancel() публичный Метод

Do the configured action when the node has been cancelled.
public onCancel ( ) : NodeActionCommand
Результат NodeActionCommand

onComplete() публичный Метод

Do the configured action when the node has completed successfully.
public onComplete ( ) : NodeActionCommand
Результат NodeActionCommand

onMaxAttemptsReached() публичный Метод

Do the configured action when the node finished without a valid input from the user.
public onMaxAttemptsReached ( ) : NodeActionCommand
Результат NodeActionCommand

whenNode() публичный Метод

Sets the controlled node.
public whenNode ( string $name ) : NodeActionCommand
$name string The name of the controlled node.
Результат NodeActionCommand

withInput() публичный Метод

Do the configured action when the node has completed successfully with this specific input from the user. Very useful for menues.
public withInput ( string $input ) : NodeActionCommand
$input string The expected input from the user.
Результат NodeActionCommand

Описание свойств

$action защищенное свойство

protected $action

$data защищенное свойство

protected $data

$nodeName защищенное свойство

protected $nodeName

$result защищенное свойство

protected $result