function Auth::__construct

Same name and namespace in other branches
  1. 9 core/modules/locale/tests/modules/early_translation_test/src/Auth.php \Drupal\early_translation_test\Auth::__construct()
  2. 8.9.x core/modules/locale/tests/modules/early_translation_test/src/Auth.php \Drupal\early_translation_test\Auth::__construct()
  3. 10 core/modules/locale/tests/modules/early_translation_test/src/Auth.php \Drupal\early_translation_test\Auth::__construct()

Constructs an authentication provider object.

Parameters

\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.

File

core/modules/locale/tests/modules/early_translation_test/src/Auth.php, line 27

Class

Auth
Test authentication provider.

Namespace

Drupal\early_translation_test

Code

public function __construct(EntityTypeManagerInterface $entity_type_manager) {
    // Authentication providers are called early during in the bootstrap.
    // Getting the user storage used to result in a circular reference since
    // translation involves a call to \Drupal\locale\LocaleLookup that tries to
    // get the user roles.
    // @see https://www.drupal.org/node/2241461
    $this->userStorage = $entity_type_manager->getStorage('user');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.