PHP Class raoul2000\workflow\source\file\MinimalArrayParser

Following rules apply : - the array must be associative, each key being a status Id, and each value is an array of target status id. - no 'initialStatusId' is required : the first status defined is considered as the initial status - no additional attribute is supported : label, metadata, transition For example :
[
'draft'     => ['ready', 'delivered'],
'ready'     => ['draft', 'delivered'],
'delivered' => ['payed', 'archived'],
'payed'     => ['archived'],
'archived'  => []
]
You can also use a comma separated list of status for the end status list instead of an array. For example :
[
'draft'     => 'ready, delivered',
'ready'     => 'draft, delivered',
'delivered' => 'payed, archived',
'payed'     => 'archived',
'archived'  => []
]
Inheritance: extends WorkflowArrayParser
Mostra file Open project: raoul2000/yii2-workflow Class Usage Examples

Public Methods

Method Description
parse ( string $wId, array $definition, raoul2000\workflow\source\file\WorkflowFileSource $source ) : array Parse a workflow defined as a PHP Array.

Private Methods

Method Description
normalizeStatusIds ( array $ids, string $workflowId, $source )

Method Details

parse() public method

The workflow definition passed as argument is turned into an array that can be used by the WorkflowFileSource components.
public parse ( string $wId, array $definition, raoul2000\workflow\source\file\WorkflowFileSource $source ) : array
$wId string
$definition array
$source raoul2000\workflow\source\file\WorkflowFileSource
return array The parse workflow array definition