PHP Class ezcWorkflow, Workflow

Inheritance: implements Countable, implements ezcWorkflowVisitable
Show file Open project: zetacomponents/workflow Class Usage Examples

Protected Properties

Property Type Description
$properties array(string=>mixed) Container to hold the properties
$variableHandlers array The variable handlers of this workflow.

Public Methods

Method Description
__construct ( string $name, ezcWorkflowNodeStart $startNode = null, ezcWorkflowNodeEnd $endNode = null, ezcWorkflowNodeFinally $finallyNode = null ) Constructs a new workflow object with the name $name.
__get ( string $propertyName ) : mixed Property read access.
__isset ( string $propertyName ) : boolean Property isset access.
__set ( string $propertyName, mixed $val ) Property write access.
accept ( ezcWorkflowVisitor $visitor ) Overridden implementation of accept() calls accept on the start node.
addVariableHandler ( string $variableName, string $className ) Sets the class $className to handle the variable named $variableName.
count ( ) : integer Returns the number of nodes of this workflow.
getVariableHandlers ( ) : array Returns the variable handlers.
hasSubWorkflows ( ) : boolean Returns true when the workflow has sub workflows (ie. when it contains ezcWorkflowNodeSubWorkflow nodes) and false otherwise.
isInteractive ( ) : boolean Returns true when the workflow requires user interaction (ie. when it contains ezcWorkflowNodeInput nodes) and false otherwise.
removeVariableHandler ( string $variableName ) : boolean Removes the handler for $variableName and returns true on success.
reset ( ) Resets the nodes of this workflow.
setVariableHandlers ( array $variableHandlers ) Sets handlers for multiple variables.
verify ( ) Verifies the specification of this workflow.

Method Details

__construct() public method

Use $startNode and $endNode parameters if you don't want to use the default start and end nodes. $name must uniquely identify the workflow within the system.
public __construct ( string $name, ezcWorkflowNodeStart $startNode = null, ezcWorkflowNodeEnd $endNode = null, ezcWorkflowNodeFinally $finallyNode = null )
$name string The name of the workflow.
$startNode ezcWorkflowNodeStart The start node of the workflow.
$endNode ezcWorkflowNodeEnd The default end node of the workflow.
$finallyNode ezcWorkflowNodeFinally The start of a node sequence that is executed when a workflow execution is cancelled.

__get() public method

Property read access.
public __get ( string $propertyName ) : mixed
$propertyName string Name of the property.
return mixed Value of the property or null.

__isset() public method

Property isset access.
public __isset ( string $propertyName ) : boolean
$propertyName string Name of the property.
return boolean True is the property is set, otherwise false.

__set() public method

Property write access.
public __set ( string $propertyName, mixed $val )
$propertyName string Name of the property.
$val mixed The value for the property.

accept() public method

Overridden implementation of accept() calls accept on the start node.
public accept ( ezcWorkflowVisitor $visitor )
$visitor ezcWorkflowVisitor

addVariableHandler() public method

$className must be the name of a class implementing the ezcWorkflowVariableHandler interface.
public addVariableHandler ( string $variableName, string $className )
$variableName string
$className string

count() public method

Returns the number of nodes of this workflow.
public count ( ) : integer
return integer

getVariableHandlers() public method

The format of the returned array is array( 'variableName' => ezcWorkflowVariableHandler )
public getVariableHandlers ( ) : array
return array

hasSubWorkflows() public method

Returns true when the workflow has sub workflows (ie. when it contains ezcWorkflowNodeSubWorkflow nodes) and false otherwise.
public hasSubWorkflows ( ) : boolean
return boolean true when the workflow has sub workflows, false otherwise.

isInteractive() public method

Returns true when the workflow requires user interaction (ie. when it contains ezcWorkflowNodeInput nodes) and false otherwise.
public isInteractive ( ) : boolean
return boolean true when the workflow is interactive, false otherwise.

removeVariableHandler() public method

Returns false if no handler was set for $variableName.
public removeVariableHandler ( string $variableName ) : boolean
$variableName string
return boolean

reset() public method

See the documentation of ezcWorkflowVisitorReset for details.
public reset ( )

setVariableHandlers() public method

The format of $variableHandlers is array( 'variableName' => ezcWorkflowVariableHandler )
public setVariableHandlers ( array $variableHandlers )
$variableHandlers array

verify() public method

See the documentation of ezcWorkflowVisitorVerification for details.
public verify ( )

Property Details

$properties protected property

Container to hold the properties
protected array(string=>mixed) $properties
return array(string=>mixed)

$variableHandlers protected property

The variable handlers of this workflow.
protected array $variableHandlers
return array