You are here

public function NewRelicRpmSettings::submitForm in New Relic 8

Same name and namespace in other branches
  1. 2.x src/Form/NewRelicRpmSettings.php \Drupal\new_relic_rpm\Form\NewRelicRpmSettings::submitForm()
  2. 2.0.x src/Form/NewRelicRpmSettings.php \Drupal\new_relic_rpm\Form\NewRelicRpmSettings::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 ConfigFormBase::submitForm

File

src/Form/NewRelicRpmSettings.php, line 195

Class

NewRelicRpmSettings
Provides a settings form to configure the New Relic RPM module.

Namespace

Drupal\new_relic_rpm\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('new_relic_rpm.settings');
  $variables = [
    'api_key',
    'track_drush',
    'track_cron',
    'ignore_roles',
    'ignore_urls',
    'bg_urls',
    'exclusive_urls',
    'watchdog_severities',
    'override_exception_handler',
    'module_deployment',
    'config_import',
    'views_log_slow',
    'views_log_threshold',
    'disable_autorum',
  ];
  foreach ($variables as $variable) {
    $config
      ->set($variable, $form_state
      ->getValue($variable));
  }
  $config
    ->save();
  parent::submitForm($form, $form_state);
}