PHP Interface raoul2000\workflow\source\IWorkflowSource

Show file Open project: raoul2000/yii2-workflow

Public Methods

Method Description
getAllStatuses ( string $id ) : raoul2000\workflow\base\StatusInterface[] Returns an array containing all Status instances belonging to the workflow whose id is passed as argument.
getStatus ( mixed $id, $model = null ) : raoul2000\workflow\base\StatusInterface Returns the Status instance for a given status id.
getTransition ( mixed $startId, mixed $endId, mixed $model = null ) : raoul2000\workflow\base\TransitionInterface Returns the transitions that leaves status $startId and reaches status $endId.
getTransitions ( mixed $statusId, $model = null ) : raoul2000\workflow\base\TransitionInterface[] Returns an array of transitions leaving the status whose id is passed as argument.
getWorkflow ( mixed $id ) : raoul2000\workflow\base\WorkflowInterface Returns the workflow instance whose id is passed as argument.

Method Details

getAllStatuses() public method

Returns an array containing all Status instances belonging to the workflow whose id is passed as argument.
public getAllStatuses ( string $id ) : raoul2000\workflow\base\StatusInterface[]
$id string workflow Id
return raoul2000\workflow\base\StatusInterface[] list of status. The array key is the status ID

getStatus() public method

In case of unexpected error the implementation must return a WorkflowException.
public getStatus ( mixed $id, $model = null ) : raoul2000\workflow\base\StatusInterface
$id mixed the status id
return raoul2000\workflow\base\StatusInterface the status instance or NULL if no status could be found for this id.

getTransition() public method

Returns the transitions that leaves status $startId and reaches status $endId.
public getTransition ( mixed $startId, mixed $endId, mixed $model = null ) : raoul2000\workflow\base\TransitionInterface
$startId mixed
$endId mixed
$model mixed @return \raoul2000\workflow\base\TransitionInterface the transition between start and end status
return raoul2000\workflow\base\TransitionInterface

getTransitions() public method

If no status is found for this id, a WorkflowException must be thrown. If not outgoing transition exists for the status, an empty array must be returned. The array returned must be indexed by status Id
public getTransitions ( mixed $statusId, $model = null ) : raoul2000\workflow\base\TransitionInterface[]
$statusId mixed
return raoul2000\workflow\base\TransitionInterface[] an array containing all out going transition from $statusId. If no such transition exist, this method returns an empty array.

getWorkflow() public method

In case of unexpected error the implementation must return a WorkflowException.
public getWorkflow ( mixed $id ) : raoul2000\workflow\base\WorkflowInterface
$id mixed the workflow id
return raoul2000\workflow\base\WorkflowInterface the workflow instance or NULL if no workflow could be found.