You are here

public function PasswordPolicyRolesForm::submitForm in Password Policy 8.3

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

src/Form/PasswordPolicyRolesForm.php, line 74

Class

PasswordPolicyRolesForm
The form to select roles that are associated to the policy.

Namespace

Drupal\password_policy\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $cached_values = $form_state
    ->getTemporaryValue('wizard');

  /** @var \Drupal\password_policy\Entity\PasswordPolicy $policy */
  $policy = $cached_values['password_policy'];
  $policy
    ->set('roles', array_filter($form_state
    ->getValue('roles')));
}