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