You are here

function ldap_user_module_preinstall in Lightweight Directory Access Protocol (LDAP) 8.3

Same name and namespace in other branches
  1. 8.4 ldap_user/ldap_user.install \ldap_user_module_preinstall()

Implements hook_module_preinstall().

File

ldap_user/ldap_user.install, line 16
Install, update and uninstall functions for the LDAP User module.

Code

function ldap_user_module_preinstall($module) {
  if ($module == 'ldap_user') {
    $type = \Drupal::entityTypeManager()
      ->getDefinition('user');
    $fields = ldap_user_entity_base_field_info($type);
    foreach ($fields as $name => $data) {
      \Drupal::entityDefinitionUpdateManager()
        ->installFieldStorageDefinition($name, 'user', 'ldap_user', $data);
    }
  }
}