You are here

public function BackupDatabaseSettingsForm::submitForm in Backup Database 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/BackupDatabaseSettingsForm.php, line 222
Contains \Drupal\backup_db\Form\BackupDatabaseSettingsForm.

Class

BackupDatabaseSettingsForm
BackupDatabaseSettingsForm class.

Namespace

Drupal\backup_db\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();

  // Save settings.
  $this
    ->config('backup_db.settings')
    ->set('path', $values['path'])
    ->set('date', $values['date'])
    ->set('settings.compress', $values['compress'])
    ->set('settings.no_data', $values['no_data'])
    ->set('settings.add_drop_table', $values['add_drop_table'])
    ->set('settings.single_transaction', $values['single_transaction'])
    ->set('settings.lock_tables', $values['lock_tables'])
    ->set('settings.add_locks', $values['add_locks'])
    ->set('settings.extended_insert', $values['extended_insert'])
    ->set('settings.complete_insert', $values['complete_insert'])
    ->set('settings.disable_keys', $values['disable_keys'])
    ->set('settings.where', $values['where'])
    ->set('settings.no_create_info', $values['no_create_info'])
    ->set('settings.skip_triggers', $values['skip_triggers'])
    ->set('settings.add_drop_trigger', $values['add_drop_trigger'])
    ->set('settings.routines', $values['routines'])
    ->set('settings.hex_blob', $values['hex_blob'])
    ->set('settings.databases', $values['databases'])
    ->set('settings.add_drop_database', $values['add_drop_database'])
    ->set('settings.skip_tz_utc', $values['skip_tz_utc'])
    ->set('settings.no_autocommit', $values['no_autocommit'])
    ->set('settings.default_character_set', $values['default_character_set'])
    ->set('settings.skip_comments', $values['skip_comments'])
    ->set('settings.skip_dump_date', $values['skip_dump_date'])
    ->save();
  parent::submitForm($form, $form_state);
}