You are here

public function WebformAdminConfigSubmissionsForm::submitForm in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Form/AdminConfig/WebformAdminConfigSubmissionsForm.php \Drupal\webform\Form\AdminConfig\WebformAdminConfigSubmissionsForm::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 WebformAdminConfigBaseForm::submitForm

File

src/Form/AdminConfig/WebformAdminConfigSubmissionsForm.php, line 273

Class

WebformAdminConfigSubmissionsForm
Configure webform admin settings for submissions.

Namespace

Drupal\webform\Form\AdminConfig

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $settings = $form_state
    ->getValue('submission_settings') + $form_state
    ->getValue('submission_behaviors') + $form_state
    ->getValue('submission_limits') + $form_state
    ->getValue('draft_settings') + $form_state
    ->getValue('bulk_form_settings') + $form_state
    ->getValue('views_settings');

  // Update config and submit form.
  $config = $this
    ->config('webform.settings');
  $config
    ->set('settings', $settings + $config
    ->get('settings'));
  $config
    ->set('purge', $form_state
    ->getValue('purge'));
  parent::submitForm($form, $form_state);
}