PHP Class raoul2000\workflow\validation\WorkflowScenario

Show file Open project: raoul2000/yii2-workflow Class Usage Examples

Public Methods

Method Description
changeStatus ( string $start, string $end ) : string Returns the scenario name for a change status action.
enterStatus ( string $status = self::ANY_STATUS ) : string Returns the scenario name for a enter status action.
enterWorkflow ( string $workflowId = self::ANY_WORKFLOW ) : string Returns the scenario name for a enter workflow action.
leaveStatus ( string $status = self::ANY_STATUS ) : string Returns the scenario name for a leave status action.
leaveWorkflow ( string $workflowId = self::ANY_WORKFLOW ) : string Returns the scenario name for a leave workflow action.
match ( string $scenario1, string $scenario2 ) : boolean Test if 2 scenario match.

Method Details

changeStatus() public static method

Returns the scenario name for a change status action.
public static changeStatus ( string $start, string $end ) : string
$start string the absolute start status Id
$end string the absolute end status Id
return string the scenario name

enterStatus() public static method

If no argument is passed to this method, it returns a scenario name that matched any status entrance.
public static enterStatus ( string $status = self::ANY_STATUS ) : string
$status string the aboslute id of the entered status
return string the scenario name

enterWorkflow() public static method

If no argument is passed to this method, the scenario name returned matches enter in any workflow.
public static enterWorkflow ( string $workflowId = self::ANY_WORKFLOW ) : string
$workflowId string the workflow id
return string the scenario name

leaveStatus() public static method

If no argument is passed to this method, it returns a scenario name that matched any status leave.
public static leaveStatus ( string $status = self::ANY_STATUS ) : string
$status string the aboslute id of the status that is left
return string the scenario name

leaveWorkflow() public static method

If no argument is passed to this method, the scenario name returned matches leaving any workflow.
public static leaveWorkflow ( string $workflowId = self::ANY_WORKFLOW ) : string
$workflowId string the workflow id
return string the scenario name

match() public static method

Test if 2 scenario match.
public static match ( string $scenario1, string $scenario2 ) : boolean
$scenario1 string scenario name
$scenario2 string scenario name
return boolean TRUE if both scenario names match, FALSE otherwise