function WorkflowTransitionDeleteForm::submitForm

Same name in other branches
  1. 8.9.x core/modules/workflows/src/Form/WorkflowTransitionDeleteForm.php \Drupal\workflows\Form\WorkflowTransitionDeleteForm::submitForm()
  2. 10 core/modules/workflows/src/Form/WorkflowTransitionDeleteForm.php \Drupal\workflows\Form\WorkflowTransitionDeleteForm::submitForm()
  3. 11.x core/modules/workflows/src/Form/WorkflowTransitionDeleteForm.php \Drupal\workflows\Form\WorkflowTransitionDeleteForm::submitForm()

Overrides FormInterface::submitForm

File

core/modules/workflows/src/Form/WorkflowTransitionDeleteForm.php, line 95

Class

WorkflowTransitionDeleteForm
Builds the form to delete transitions from Workflow entities.

Namespace

Drupal\workflows\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
    $this->workflow
        ->getTypePlugin()
        ->deleteTransition($this->transition
        ->id());
    $this->workflow
        ->save();
    $this->messenger()
        ->addStatus($this->t('%transition transition deleted.', [
        '%transition' => $this->transition
            ->label(),
    ]));
    $form_state->setRedirectUrl($this->getCancelUrl());
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.