public function DblogFilterForm::submitForm in Drupal 9
Same name and namespace in other branches
- 8 core/modules/dblog/src/Form/DblogFilterForm.php \Drupal\dblog\Form\DblogFilterForm::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/ DblogFilterForm.php, line 79
Class
- DblogFilterForm
- Provides the database logging filter form.
Namespace
Drupal\dblog\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$filters = dblog_filters();
$session_filters = $this
->getRequest()
->getSession()
->get('dblog_overview_filter', []);
foreach ($filters as $name => $filter) {
if ($form_state
->hasValue($name)) {
$session_filters[$name] = $form_state
->getValue($name);
}
}
$this
->getRequest()
->getSession()
->set('dblog_overview_filter', $session_filters);
}