You are here

public function WorkflowTransitionAddForm::exists in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/workflows/src/Form/WorkflowTransitionAddForm.php \Drupal\workflows\Form\WorkflowTransitionAddForm::exists()
  2. 10 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
Class WorkflowTransitionAddForm.

Namespace

Drupal\workflows\Form

Code

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);
}