public function UpdateSettingsForm::submitForm

Implements \Drupal\Core\Form\FormInterface::submitForm().

Overrides SystemConfigFormBase::submitForm

File

drupal/core/modules/update/lib/Drupal/update/UpdateSettingsForm.php, line 106
Contains \Drupal\update\UpdateSettingsForm.

Class

UpdateSettingsForm
Configure update settings for this site.

Namespace

Drupal\update

Code

public function submitForm(array &$form, array &$form_state) {
  $config = $this->configFactory
    ->get('update.settings');

  // See if the update_check_disabled setting is being changed, and if so,
  // invalidate all update status data.
  if ($form_state['values']['update_check_disabled'] != $config
    ->get('check.disabled_extensions')) {
    update_storage_clear();
  }
  $config
    ->set('check.disabled_extensions', $form_state['values']['update_check_disabled'])
    ->set('check.interval_days', $form_state['values']['update_check_frequency'])
    ->set('notification.emails', $form_state['notify_emails'])
    ->set('notification.threshold', $form_state['values']['update_notification_threshold'])
    ->save();
  parent::submitForm($form, $form_state);
}