You are here

public function SyncMappingHelper::loadSyncMappings in Lightweight Directory Access Protocol (LDAP) 8.3

Fetches the sync mappings from cache or loads them from configuration.

1 call to SyncMappingHelper::loadSyncMappings()
SyncMappingHelper::__construct in ldap_user/src/Helper/SyncMappingHelper.php
Constructor.

File

ldap_user/src/Helper/SyncMappingHelper.php, line 157

Class

SyncMappingHelper
Helper class to process user field synchronisation mappings.

Namespace

Drupal\ldap_user\Helper

Code

public function loadSyncMappings() {
  $syncMappingsCache = \Drupal::cache()
    ->get('ldap_user_sync_mapping');
  if ($syncMappingsCache) {
    $this->syncMapping = $syncMappingsCache->data;
  }
  else {
    $this
      ->processSyncMappings();
    \Drupal::cache()
      ->set('ldap_user_sync_mapping', $this->syncMapping);
  }
}