public function WorkflowTransitionDeleteForm::submitForm in Drupal 10
Same name and namespace in other branches
- 8 core/modules/workflows/src/Form/WorkflowTransitionDeleteForm.php \Drupal\workflows\Form\WorkflowTransitionDeleteForm::submitForm()
- 9 core/modules/workflows/src/Form/WorkflowTransitionDeleteForm.php \Drupal\workflows\Form\WorkflowTransitionDeleteForm::submitForm()
Form submission handler.
Parameters
array $form: An associative array containing the structure of the form.
\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.
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\FormCode
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());
}