function SessionWorkspaceNegotiator::__construct

Same name and namespace in other branches
  1. 11.x core/modules/workspaces/src/Negotiator/SessionWorkspaceNegotiator.php \Drupal\workspaces\Negotiator\SessionWorkspaceNegotiator::__construct()
  2. 10 core/modules/workspaces/src/Negotiator/SessionWorkspaceNegotiator.php \Drupal\workspaces\Negotiator\SessionWorkspaceNegotiator::__construct()
  3. 9 core/modules/workspaces/src/Negotiator/SessionWorkspaceNegotiator.php \Drupal\workspaces\Negotiator\SessionWorkspaceNegotiator::__construct()
  4. main core/modules/workspaces/src/Negotiator/SessionWorkspaceNegotiator.php \Drupal\workspaces\Negotiator\SessionWorkspaceNegotiator::__construct()

Constructor.

Parameters

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

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

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

File

core/modules/workspaces/src/Negotiator/SessionWorkspaceNegotiator.php, line 47

Class

SessionWorkspaceNegotiator
Defines the session workspace negotiator.

Namespace

Drupal\workspaces\Negotiator

Code

public function __construct(AccountInterface $current_user, Session $session, EntityTypeManagerInterface $entity_type_manager) {
  $this->currentUser = $current_user;
  $this->session = $session;
  $this->workspaceStorage = $entity_type_manager->getStorage('workspace');
}

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