function WorkflowTypeBase::getState
Same name in other branches
- 9 core/modules/workflows/src/Plugin/WorkflowTypeBase.php \Drupal\workflows\Plugin\WorkflowTypeBase::getState()
- 8.9.x core/modules/workflows/src/Plugin/WorkflowTypeBase.php \Drupal\workflows\Plugin\WorkflowTypeBase::getState()
- 10 core/modules/workflows/src/Plugin/WorkflowTypeBase.php \Drupal\workflows\Plugin\WorkflowTypeBase::getState()
Overrides WorkflowTypeInterface::getState
1 call to WorkflowTypeBase::getState()
- ContentModeration::getState in core/
modules/ content_moderation/ src/ Plugin/ WorkflowType/ ContentModeration.php
2 methods override WorkflowTypeBase::getState()
- ContentModeration::getState in core/
modules/ content_moderation/ src/ Plugin/ WorkflowType/ ContentModeration.php - PredefinedStatesWorkflowTestType::getState in core/
modules/ workflows/ tests/ modules/ workflow_type_test/ src/ Plugin/ WorkflowType/ PredefinedStatesWorkflowTestType.php
File
-
core/
modules/ workflows/ src/ Plugin/ WorkflowTypeBase.php, line 153
Class
- WorkflowTypeBase
- A base class for Workflow type plugins.
Namespace
Drupal\workflows\PluginCode
public function getState($state_id) {
if (!isset($this->configuration['states'][$state_id])) {
throw new \InvalidArgumentException("The state '{$state_id}' does not exist in workflow.");
}
return new State($this, $state_id, $this->configuration['states'][$state_id]['label'], $this->configuration['states'][$state_id]['weight']);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.