You are here

public function UserSwitch::__construct in User Switch 8

Constructs.

Parameters

\Drupal\Core\Session\AccountInterface $current_user: The current user.

\Drupal\Core\Extension\ModuleHandlerInterface $module_handler: The module handler.

\Drupal\Core\Session\SessionManagerInterface $session_manager: The session manager.

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

Symfony\Component\HttpFoundation\Session\Session $session: The session manager.

File

src/UserSwitch.php, line 68

Class

UserSwitch
Defines a UserSwitch service to switch user account.

Namespace

Drupal\userswitch

Code

public function __construct(AccountInterface $current_user, ModuleHandlerInterface $module_handler, SessionManagerInterface $session_manager, EntityTypeManagerInterface $entityTypeManager, Session $session) {
  $this->moduleHandler = $module_handler;
  $this->currentUser = $current_user;
  $this->sessionManager = $session_manager;
  $this->entityTypeManager = $entityTypeManager;
  $this->session = $session;
}