Метод | Описание | |
---|---|---|
getAllStatusListData ( string $workflowId, IWorkflowSource $workflowSource ) : array | Returns an associative array containing all statuses that belong to a workflow. | |
getNextStatus ( |
Returns the status string of the next valid status from the list of transitions | |
getNextStatusListData ( |
Returns an associative array containing all statuses that can be reached by model. | |
getStatusDropDownData ( |
Returns the items and options for a dropDownList All status options are in the list, but invalid transitions are disabled | |
isValidNextStatus ( |
Checks if a given status is a valid transition from the current status | |
renderLabel ( |
Displays the status for the model passed as argument. |
echo Html::dropDownList( 'status', null, WorkflowHelper::getAllStatusListData( $post->getWorkflow()->getId(), $post->getWorkflowSource() ) )
public static getAllStatusListData ( string $workflowId, IWorkflowSource $workflowSource ) : array | ||
$workflowId | string | |
$workflowSource | IWorkflowSource | |
Результат | array |
public static getNextStatus ( |
||
$model | ||
Результат | string |
public static getNextStatusListData ( |
||
$model | ||
$validate | boolean | when TRUE only those status with successfull attribute validation are included. When FALSE (default) Attribute validation is done performed. |
$beforeEvents | boolean | when TRUE all configured *before* events are fired : only the status that don't invalidate the workflow event are included in the returned array, otherwise no event is fired and all next status are included |
$includeCurrent | boolean | when TRUE the current model status is added to the returned array. When FALSE (default) only next statuses are included |
Результат | array |
$statusDropDownData = WorkflowHelper::getStatusDropDownData($model); Html echo Html::dropDownList('status', $model->status, $statusDropdown['items'], ['options' => $statusDropdown['options']]); ActiveForm echo $form->field($model, 'status')->dropDownList($statusDropDownData['items'], ['options' => $statusDropDownData['options']]);
public static getStatusDropDownData ( |
||
$model | ||
Результат | array |
public static isValidNextStatus ( |
||
$model | ||
$status_id | string | |
Результат | boolean |
'status' => [
'draft' => [
'label' => 'Draft',
'transition' => ['ready' ],
'metadata' => [
'labelTemplate' => '{label}'
]
],
public static renderLabel ( |
||
$model | ||
Результат | string | null | the HTML rendered status or null if not labelTemplate is found |