You are here

public function UserAccessForm::submitForm in Taxonomy Access Control Lite 8

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/UserAccessForm.php, line 85

Class

UserAccessForm
Builds the form for User Access.

Namespace

Drupal\tac_lite\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $uid = $this->uid;

  // Go through each scheme and copy the form value into the data element.
  $settings = \Drupal::config('tac_lite.settings');
  $schemes = $settings
    ->get('tac_lite_schemes');
  for ($i = 1; $i <= $schemes; $i++) {
    $config = SchemeForm::tacLiteConfig($i);
    if ($config['name']) {
      \Drupal::service('user.data')
        ->set('tac_lite', $uid, $config['realm'], $form_state
        ->getValue($config['realm']));
    }
  }
}