public function BackupMigrateQuickBackupForm::submitForm in Backup and Migrate 8.4
Same name and namespace in other branches
- 5.0.x src/Form/BackupMigrateQuickBackupForm.php \Drupal\backup_migrate\Form\BackupMigrateQuickBackupForm::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 FormInterface::submitForm
File
- src/
Form/ BackupMigrateQuickBackupForm.php, line 70
Class
- BackupMigrateQuickBackupForm
- Provides a form for performing a 1-click site backup.
Namespace
Drupal\backup_migrate\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$values = $form_state
->getValues();
$config = [];
// Load the settings profile if one is selected.
if (!empty($values['settings_profile_id'])) {
$config = SettingsProfile::load($values['settings_profile_id'])
->get('config');
}
backup_migrate_perform_backup($values['source_id'], $values['destination_id'], $config);
}