public function PredefinedStatesWorkflowTestType::addState in Drupal 10
Same name and namespace in other branches
- 8 core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/PredefinedStatesWorkflowTestType.php \Drupal\workflow_type_test\Plugin\WorkflowType\PredefinedStatesWorkflowTestType::addState()
- 9 core/modules/workflows/tests/modules/workflow_type_test/src/Plugin/WorkflowType/PredefinedStatesWorkflowTestType.php \Drupal\workflow_type_test\Plugin\WorkflowType\PredefinedStatesWorkflowTestType::addState()
Adds a state to the workflow.
Parameters
string $state_id: The state's ID.
string $label: The state's label.
Return value
$this
Throws
\InvalidArgumentException Thrown if a state already exists or state ID is invalid.
Overrides WorkflowTypeBase::addState
File
- core/
modules/ workflows/ tests/ modules/ workflow_type_test/ src/ Plugin/ WorkflowType/ PredefinedStatesWorkflowTestType.php, line 60
Class
- PredefinedStatesWorkflowTestType
- Test workflow type.
Namespace
Drupal\workflow_type_test\Plugin\WorkflowTypeCode
public function addState($state_id, $label) {
// States cannot be added on this workflow.
return $this;
}