simpleWorkflow
  • Class
  • Tree

Classes

  • SWActiveRecord
  • SWActiveRecordBehavior
  • SWComponent
  • SWEvent
  • SWException
  • SWHelper
  • SWNode
  • SWPhpWorkflowSource
  • SWValidator
  • SWWorkflowSource
  • SWyEdConverter
  • SWyEdConverterDOM

Class SWHelper

this class provides helper methods for the simpleWorkflow behavior

Located at SWHelper.php

Methods summary

public static array
# nextStatuslistData( CModel $model, array $options = array() )

Returns the list of all statuses that can be reached from current status of the model passed as argument. The returned array is in the form suitable for dropDownList and listBox:

   array(
        'statusId' => 'status label',
        'status Id2' => 'status label 2',
        etc ...
   )
Use the $options argument to speficy following options :
  • prompt : specifies the prompt text shown as the first list option. Its value is empty. Note, the prompt text will NOT be HTML-encoded
  • includeCurrent : boolean, if TRUE (default) the current model status is included in the list, otherwise current model status is not inserted in the returned array.
  • exclude : array, list of statuses that should not be inserted in the returned array
Note that each status label is html encode by default.

Returns the list of all statuses that can be reached from current status of the model passed as argument. The returned array is in the form suitable for dropDownList and listBox:

   array(
        'statusId' => 'status label',
        'status Id2' => 'status label 2',
        etc ...
   )
Use the $options argument to speficy following options :
  • prompt : specifies the prompt text shown as the first list option. Its value is empty. Note, the prompt text will NOT be HTML-encoded
  • includeCurrent : boolean, if TRUE (default) the current model status is included in the list, otherwise current model status is not inserted in the returned array.
  • exclude : array, list of statuses that should not be inserted in the returned array
Note that each status label is html encode by default.

Parameters

$model
CModel
$model the data model attaching a simpleWorkflow behavior
$options
array
$options additional options

Returns

array
the list data that can be used in dropDownList and listBox
public static array
# allStatuslistData( CModel $model, array $options = array() )

Returns the list of all statuses belonging to the workflow the model passed as argument is in. see SWHelper::nextStatuslistData() for argument options

Returns the list of all statuses belonging to the workflow the model passed as argument is in. see SWHelper::nextStatuslistData() for argument options

Parameters

$model
CModel
the data model attaching a simpleWorkflow behavior
$options
array
additional options

Returns

array
the list data that can be used in dropDownList and listBox
public static
# statusListData( CModel $model, array $statusList, array $options = array() )

Create an array containing where keys are statusIds in the form workflowId/statusId and the value is the status label. Note that by default this method never inserts the status of the model passed as argument. see SWHelper::nextStatuslistData() for argument options

Create an array containing where keys are statusIds in the form workflowId/statusId and the value is the status label. Note that by default this method never inserts the status of the model passed as argument. see SWHelper::nextStatuslistData() for argument options

Parameters

$model
CModel
the data model attaching a simpleWorkflow behavior
$statusList
array
$statusList array of string where each value is the statusId
$options
array
$options the list data that can be used in dropDownList and listBox

Magic methods summary

simpleWorkflow API documentation generated by ApiGen 2.8.0