function 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);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.