You are here

public function WebformAdminConfigVariantsForm::submitForm in Webform 8.5

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

Class

WebformAdminConfigVariantsForm
Configure webform admin settings for variants.

Namespace

Drupal\webform\Form\AdminConfig

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $excluded_variants = $this
    ->convertIncludedToExcludedPluginIds($this->variantManager, $form_state
    ->getValue('excluded_variants'));

  // Update config and submit form.
  $config = $this
    ->config('webform.settings');
  $config
    ->set('variant', [
    'excluded_variants' => $excluded_variants,
  ]);
  parent::submitForm($form, $form_state);
}