Свойство | Тип | Описание | |
---|---|---|---|
$definitionCache | The workflow definition cache used by this source component can be be specified in one of the following forms : - string : ID of an existing cache component registered in the current Yii::$app. - a configuration array: the array must contain a class element which is treated as the object class, and the rest of the name-value pairs will be used to initialize the corresponding object properties - object : the instance of the cache component By default no cache is used. | ||
$definitionLoader | The workflow definition loader used by this source component can be be specified in one of the following forms : - string : ID of an existing workflow definition component registered in the current Yii::$app. - a configuration array: the array must contain a class element which is treated as the object class, and the rest of the name-value pairs will be used to initialize the corresponding object properties - object : the instance of the workflow definition loader Note that in all cases, the workflow definition loader configured here must implement the WorkflowDefinitionLoader interface. If this attribute is not set then a default object of type \raoul2000\workflow\source\file\PhpClassLoader is used. |
Метод | Описание | |
---|---|---|
__construct ( array $config = [] ) | Constructor method. | |
addWorkflowDefinition ( string $workflowId, array $definition, boolean $overwrite = false ) : boolean | Add a workflow definition array to the collection of workflow definitions handled by this source. | |
getAllStatuses ( $workflowId ) | Returns an array containing all statuses belonging to a workflow. | |
getClassMap ( ) : string[] | Returns the class map array for this Workflow source instance. | |
getClassMapByType ( string $type ) : string | null | Returns the class name that implement the type passed as argument. | |
getDefinitionCache ( ) : null | yii\caching\Cache | Return the workflow definition cache component used by this workflow source or NULL if no cache is used. | |
getDefinitionLoader ( ) : |
Returns the Workflow Definition Loader component. | |
getStatus ( string $id, mixed $defaultWorkflowId = null ) : |
Returns the status object instance whose id is passed as argument. | |
getTransition ( $startId, $endId, $defaultWorkflowId = null ) | Returns the transition between $startId and $endId statuses. | |
getTransitions ( $statusId, $defaultWorkflowId = null ) | Returns all out going transitions leaving the status whose id is passed as argument. | |
getWorkflow ( $id ) : |
Returns the Workflow instance whose id is passed as argument. | |
getWorkflowDefinition ( string $id ) | Loads definition for the workflow whose id is passed as argument. | |
isValidStatusId ( string $id ) : boolean | Checks if the string passed as argument can be used as a status ID. | |
isValidStatusLocalId ( string $val ) : boolean | Checks if the string passed as argument can be used as a status local ID. | |
isValidWorkflowId ( string $val ) : boolean | Checks if the string passed as argument can be used as a workflow ID. | |
parseStatusId ( string $val, Model | string $helper = null ) : string[] | Parses the string $val assuming it is a status id and returns and array containing the workflow ID and status local ID. | |
validateWorkflowDefinition ( string $wId, array $definition ) : array | Validate the workflow definition passed as argument. |
public __construct ( array $config = [] ) | ||
$config | array |
public addWorkflowDefinition ( string $workflowId, array $definition, boolean $overwrite = false ) : boolean | ||
$workflowId | string | Id of the workflow |
$definition | array | array containing the workflow definition to process |
$overwrite | boolean | When set to TRUE, the operation will fail if a workflow definition already exists for this ID. Otherwise the existing definition is overwritten. |
Результат | boolean | TRUE if the workflow definition could be added, FALSE otherwise |
public getAllStatuses ( $workflowId ) |
public getClassMap ( ) : string[] | ||
Результат | string[] |
public getDefinitionCache ( ) : null | yii\caching\Cache | ||
Результат | null | yii\caching\Cache |
public getDefinitionLoader ( ) : |
||
Результат | the workflow definition loader instance |
public getTransition ( $startId, $endId, $defaultWorkflowId = null ) |
public getTransitions ( $statusId, $defaultWorkflowId = null ) |
public getWorkflow ( $id ) : |
||
Результат | The workflow instance or NULL if no workflow could be found |
public getWorkflowDefinition ( string $id ) | ||
$id | string |
public isValidStatusId ( string $id ) : boolean | ||
$id | string | the status ID to test |
Результат | boolean | TRUE if $id is a valid status ID, FALSE otherwise. |
public isValidStatusLocalId ( string $val ) : boolean | ||
$val | string | |
Результат | boolean |
public isValidWorkflowId ( string $val ) : boolean | ||
$val | string | |
Результат | boolean | TRUE if the $val can be used as workflow id, FALSE otherwise |
public parseStatusId ( string $val, Model | string $helper = null ) : string[] | ||
$val | string | the status ID to parse. If it is not an absolute ID, $helper is used to get the workflow ID. |
$helper | Model | string | workflow Id or ActiveRecord instance used to get the workflow id if not present in $val |
Результат | string[] | array containing the workflow ID in its first index, and the status Local ID in the second |
public $definitionCache |
public $definitionLoader |