You are here

public function SettingsForm::submitForm in Permissions by Term 8

Same name and namespace in other branches
  1. 8.2 src/Form/SettingsForm.php \Drupal\permissions_by_term\Form\SettingsForm::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 ConfigFormBase::submitForm

File

src/Form/SettingsForm.php, line 51

Class

SettingsForm

Namespace

Drupal\permissions_by_term\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  \Drupal::configFactory()
    ->getEditable('permissions_by_term.settings.single_term_restriction')
    ->set('value', $form_state
    ->getValue('single_term_restriction'))
    ->save();
  node_access_rebuild(true);
  parent::submitForm($form, $form_state);
}