You are here

public function IpAnonSettings::submitForm in IP Anonymize 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/IpAnonSettings.php, line 70

Class

IpAnonSettings
Settings form for ip_anon module.

Namespace

Drupal\ip_anon\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $config = $this
    ->config('ip_anon.settings');
  $config
    ->set('policy', $form_state
    ->getValue('policy'));
  foreach (Element::children($form['period']) as $variable) {
    $config
      ->set($variable, $form_state
      ->getValue($variable));
  }
  $config
    ->save();
  parent::submitForm($form, $form_state);
}