function SwitchUserListHelper::__construct
Constructs a new SwitchUserListHelper service.
Parameters
\Drupal\Core\Session\AccountInterface $currentUser: Current user.
\Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager: The entity type manager.
\Drupal\Core\Routing\RedirectDestinationInterface $redirectDestination: The redirect destination service.
\Drupal\Core\StringTranslation\TranslationInterface $string_translation: The translation manager.
File
-
src/
SwitchUserListHelper.php, line 46
Class
- SwitchUserListHelper
- Switch user helper service.
Namespace
Drupal\develCode
public function __construct(protected AccountInterface $currentUser, EntityTypeManagerInterface $entity_type_manager, protected RedirectDestinationInterface $redirectDestination, TranslationInterface $string_translation) {
$this->userStorage = $entity_type_manager->getStorage('user');
$this->stringTranslation = $string_translation;
$this->roleStorage = $entity_type_manager->getStorage('user_role');
}