You are here

public function LdapUserMappingBaseForm::submitForm in Lightweight Directory Access Protocol (LDAP) 8.4

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

ldap_user/src/Form/LdapUserMappingBaseForm.php, line 185

Class

LdapUserMappingBaseForm
Provides the form to configure user configuration and field mapping.

Namespace

Drupal\ldap_user\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) : void {
  $mappings = $this->currentConfig
    ->get('ldapUserSyncMappings');
  $mappings[$this->direction] = $this
    ->syncMappingsFromForm($form_state
    ->getValues());
  $this->currentConfig
    ->set('ldapUserSyncMappings', $mappings)
    ->save();
  $this
    ->messenger()
    ->addMessage($this
    ->t('User synchronization configuration updated.'));
}