You are here

public function MonitoringSettingsForm::submitForm in Monitoring 8

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 ConfigFormBase::submitForm

File

src/Form/MonitoringSettingsForm.php, line 69
Contains \Drupal\monitoring\Form\MonitoringSettingsForm.

Class

MonitoringSettingsForm
Form for general Monitoring configuration.

Namespace

Drupal\monitoring\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  parent::submitForm($form, $form_state);
  $this
    ->config('monitoring.settings')
    ->set('sensor_call_logging', $form_state
    ->getValue('sensor_call_logging'))
    ->set('cron_run_sensors', $form_state
    ->getValue('cron_run_sensors'))
    ->set('disable_sensor_autocreate', $form_state
    ->getValue('disable_sensor_autocreate'))
    ->save();
}