You are here

public function AssignmentSiteForm::submitForm in Features 8.4

Same name and namespace in other branches
  1. 8.3 modules/features_ui/src/Form/AssignmentSiteForm.php \Drupal\features_ui\Form\AssignmentSiteForm::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

modules/features_ui/src/Form/AssignmentSiteForm.php, line 44

Class

AssignmentSiteForm
Configures the selected configuration assignment method for this site.

Namespace

Drupal\features_ui\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {

  // Merge in types selections.
  $settings = $this->currentBundle
    ->getAssignmentSettings(self::METHOD_ID);
  $settings['types'] = $form_state
    ->getValue('types');
  $this->currentBundle
    ->setAssignmentSettings(self::METHOD_ID, $settings)
    ->save();
  $this
    ->setRedirect($form_state);
  $this
    ->messenger()
    ->addStatus($this
    ->t('Package assignment configuration saved.'));
}