You are here

public function DblogClearLogConfirmForm::submitForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/dblog/src/Form/DblogClearLogConfirmForm.php \Drupal\dblog\Form\DblogClearLogConfirmForm::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/dblog/src/Form/DblogClearLogConfirmForm.php, line 71
Contains \Drupal\dblog\Form\DblogClearLogConfirmForm.

Class

DblogClearLogConfirmForm
Provides a confirmation form before clearing out the logs.

Namespace

Drupal\dblog\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $_SESSION['dblog_overview_filter'] = array();
  $this->connection
    ->delete('watchdog')
    ->execute();
  drupal_set_message($this
    ->t('Database log cleared.'));
  $form_state
    ->setRedirectUrl($this
    ->getCancelUrl());
}