You are here

public function PasswordPolicyGeneralForm::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/PasswordPolicyGeneralForm.php, line 40

Class

PasswordPolicyGeneralForm
The general settings of the policy not tied to constraints.

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('password_reset', $form_state
    ->getValue('password_reset'));
  $form_state
    ->setTemporaryValue('wizard', $cached_values);
}