yii2-workflow Class Reference
  • Namespace
  • Class

Namespaces

  • raoul2000
    • workflow
      • actions
      • base
      • events
      • helpers
      • source
        • file
      • validation

Interfaces

  • IWorkflowSource

Interface IWorkflowSource

Interface for WorkflowSource components.

This interface defines basic methods aimed to provide status, workflow and transitions to the SimpleStatusBehavior.

Direct known implementers

raoul2000\workflow\source\file\WorkflowFileSource

Namespace: raoul2000\workflow\source
Located at source/IWorkflowSource.php

Methods summary

public raoul2000\workflow\base\StatusInterface
# getStatus( mixed $id, $model = null )

Returns the Status instance for a given status id. In case of unexpected error the implementation must return a WorkflowException.

Returns the Status instance for a given status id. In case of unexpected error the implementation must return a WorkflowException.

Parameters

$id
the status id
$model

Returns

raoul2000\workflow\base\StatusInterface
the status instance or NULL if no status could be found for this id.

Throws

raoul2000\workflow\base\WorkflowException
unexpected error
public raoul2000\workflow\base\StatusInterface[]
# getAllStatuses( string $id )

Returns an array containing all Status instances belonging to the workflow whose id is passed as argument.

Returns an array containing all Status instances belonging to the workflow whose id is passed as argument.

Parameters

$id
workflow Id

Returns

raoul2000\workflow\base\StatusInterface[]
list of status. The array key is the status ID

Throws

raoul2000\workflow\base\WorkflowException
no workflow is found with this Id
public raoul2000\workflow\base\TransitionInterface[]
# getTransitions( mixed $statusId, $model = null )

Returns an array of transitions leaving the status whose id is passed as argument.

Returns an array of transitions leaving the status whose id is passed as argument.

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

Parameters

$statusId
$model

Returns

raoul2000\workflow\base\TransitionInterface[]

an array containing all out going transition from $statusId. If no such transition exist, this method returns an empty array.

Throws

raoul2000\workflow\base\WorkflowException
unexpected error
public raoul2000\workflow\base\TransitionInterface
# getTransition( mixed $startId, mixed $endId, mixed $model = null )

Returns the transitions that leaves status $startId and reaches status $endId.

Returns the transitions that leaves status $startId and reaches status $endId.

Parameters

$startId
$endId
$model

Returns

raoul2000\workflow\base\TransitionInterface
the transition between start and end status
public raoul2000\workflow\base\WorkflowInterface
# getWorkflow( mixed $id )

Returns the workflow instance whose id is passed as argument. In case of unexpected error the implementation must return a WorkflowException.

Returns the workflow instance whose id is passed as argument. In case of unexpected error the implementation must return a WorkflowException.

Parameters

$id
the workflow id

Returns

raoul2000\workflow\base\WorkflowInterface
the workflow instance or NULL if no workflow could be found.
yii2-workflow Class Reference API documentation generated by ApiGen