function WorkflowTypeInterface::addState
Same name in other branches
- 9 core/modules/workflows/src/WorkflowTypeInterface.php \Drupal\workflows\WorkflowTypeInterface::addState()
- 10 core/modules/workflows/src/WorkflowTypeInterface.php \Drupal\workflows\WorkflowTypeInterface::addState()
- 11.x core/modules/workflows/src/WorkflowTypeInterface.php \Drupal\workflows\WorkflowTypeInterface::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.
1 method overrides WorkflowTypeInterface::addState()
- WorkflowTypeBase::addState in core/
modules/ workflows/ src/ Plugin/ WorkflowTypeBase.php - Adds a state to the workflow.
File
-
core/
modules/ workflows/ src/ WorkflowTypeInterface.php, line 109
Class
- WorkflowTypeInterface
- An interface for Workflow type plugins.
Namespace
Drupal\workflowsCode
public function addState($state_id, $label);
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.