You are here

function user_revision_module_preinstall in User Revision 8

Implements hook_module_preinstall().

File

./user_revision.install, line 13
Install, update and uninstall functions for the user revision module.

Code

function user_revision_module_preinstall($module) {
  if ($module == 'user_revision') {
    $all_users =& drupal_static('user_revision_all_users', array());
    foreach (User::loadMultiple() as $user) {
      $all_users[$user
        ->id()] = $user
        ->toArray();
    }

    /* @var $user_storage \Drupal\Core\Entity\Sql\SqlContentEntityStorage */
    $entity_type_manager = \Drupal::service('entity_type.manager');
    $user_storage = $entity_type_manager
      ->getStorage('user');
    $entity_type_manager
      ->onEntityTypeDelete($user_storage
      ->getEntityType());
  }
}