public function BackupDatabaseCronForm::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/ BackupDatabaseCronForm.php, line 61 - Contains \Drupal\backup_db\Form\BackupDatabaseTablesForm.
Class
- BackupDatabaseCronForm
- BackupDatabaseTablesForm class.
Namespace
Drupal\backup_db\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
parent::submitForm($form, $form_state);
$this
->config('backup_db.settings')
->set('cron_interval', $form_state
->getValue('cron_interval'))
->set('cron_backup_enabled', $form_state
->getValue('cron_backup_enabled'))
->save();
\Drupal::state()
->set('backup_db.cron_next_backup', REQUEST_TIME + $form_state
->getValue('cron_interval') * 60);
}