You are here

public function SettingsForm::submitForm in Notify 8

Same name and namespace in other branches
  1. 2.0.x src/Form/SettingsForm.php \Drupal\notify\Form\SettingsForm::submitForm()
  2. 1.0.x src/Form/SettingsForm.php \Drupal\notify\Form\SettingsForm::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/SettingsForm.php, line 208

Class

SettingsForm
Defines a form that configures forms module settings.

Namespace

Drupal\notify\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();
  $this
    ->config('notify.settings')
    ->set('notify_period', $values['notify_period'])
    ->set('notify_send_hour', $values['notify_send_hour'])
    ->set('notify_attempts', $values['notify_attempts'])
    ->set('notify_batch', $values['notify_batch'])
    ->set('notify_include_updates', $values['notify_include_updates'])
    ->set('notify_unpublished', $values['notify_unpublished'])
    ->set('notify_watchdog', $values['notify_watchdog'])
    ->set('notify_weightur', $values['notify_weightur'])
    ->save();
  $this->messenger
    ->addMessage($this
    ->t('Notify admin settings saved.'));
}