public function WorkflowStateAddForm::exists in Drupal 9
Same name and namespace in other branches
- 8 core/modules/workflows/src/Form/WorkflowStateAddForm.php \Drupal\workflows\Form\WorkflowStateAddForm::exists()
Determines if the workflow state already exists.
Parameters
string $state_id: The workflow state ID.
Return value
bool TRUE if the workflow state exists, FALSE otherwise.
File
- core/
modules/ workflows/ src/ Form/ WorkflowStateAddForm.php, line 100
Class
- WorkflowStateAddForm
- Entity form variant for adding workflow states.
Namespace
Drupal\workflows\FormCode
public function exists($state_id) {
/** @var \Drupal\workflows\WorkflowInterface $original_workflow */
$original_workflow = \Drupal::entityTypeManager()
->getStorage('workflow')
->loadUnchanged($this
->getEntity()
->id());
return $original_workflow
->getTypePlugin()
->hasState($state_id);
}