function WorkflowStateDeleteForm::submitForm
Same name in other branches
- 9 core/modules/workflows/src/Form/WorkflowStateDeleteForm.php \Drupal\workflows\Form\WorkflowStateDeleteForm::submitForm()
- 8.9.x core/modules/workflows/src/Form/WorkflowStateDeleteForm.php \Drupal\workflows\Form\WorkflowStateDeleteForm::submitForm()
- 10 core/modules/workflows/src/Form/WorkflowStateDeleteForm.php \Drupal\workflows\Form\WorkflowStateDeleteForm::submitForm()
Overrides FormInterface::submitForm
File
-
core/
modules/ workflows/ src/ Form/ WorkflowStateDeleteForm.php, line 93
Class
- WorkflowStateDeleteForm
- Builds the form to delete states from Workflow entities.
Namespace
Drupal\workflows\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$workflow_label = $this->workflow
->getTypePlugin()
->getState($this->stateId)
->label();
$this->workflow
->getTypePlugin()
->deleteState($this->stateId);
$this->workflow
->save();
$this->messenger()
->addStatus($this->t('State %label deleted.', [
'%label' => $workflow_label,
]));
$form_state->setRedirectUrl($this->getCancelUrl());
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.