public function AbjsConditionDeleteConfirmForm::submitForm in A/B Test JS 8
Same name and namespace in other branches
- 2.0.x src/Form/AbjsConditionDeleteConfirmForm.php \Drupal\abjs\Form\AbjsConditionDeleteConfirmForm::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
- src/
Form/ AbjsConditionDeleteConfirmForm.php, line 105
Class
- AbjsConditionDeleteConfirmForm
- Class for confirm delete condition.
Namespace
Drupal\abjs\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$this->database
->delete('abjs_condition')
->condition('cid', $this->id)
->execute();
$this->database
->delete('abjs_test_condition')
->condition('cid', $this->id)
->execute();
$this
->messenger()
->addStatus($this
->t('Condition %id has been deleted.', [
'%id' => $this->id,
]));
$form_state
->setRedirect('abjs.condition_admin');
}