public function AssignmentAlterForm::submitForm in Features 8.4
Same name and namespace in other branches
- 8.3 modules/features_ui/src/Form/AssignmentAlterForm.php \Drupal\features_ui\Form\AssignmentAlterForm::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/ AssignmentAlterForm.php, line 61
Class
- AssignmentAlterForm
- Configures the selected configuration assignment method for this site.
Namespace
Drupal\features_ui\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
// Merge in selections.
$settings = $this->currentBundle
->getAssignmentSettings(self::METHOD_ID);
$settings = array_merge($settings, [
'core' => $form_state
->getValue('core'),
'uuid' => $form_state
->getValue('uuid'),
'user_permissions' => $form_state
->getValue('user_permissions'),
]);
$this->currentBundle
->setAssignmentSettings(self::METHOD_ID, $settings)
->save();
$this
->setRedirect($form_state);
$this
->messenger()
->addStatus($this
->t('Package assignment configuration saved.'));
}