You are here

public function LanguageNegotiator::setCurrentUser in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/language/src/LanguageNegotiator.php \Drupal\language\LanguageNegotiator::setCurrentUser()

Sets the current active user and resets all language types.

Parameters

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

Overrides LanguageNegotiatorInterface::setCurrentUser

File

core/modules/language/src/LanguageNegotiator.php, line 117

Class

LanguageNegotiator
Class responsible for performing language negotiation.

Namespace

Drupal\language

Code

public function setCurrentUser(AccountInterface $current_user) {
  $this->currentUser = $current_user;
  $this
    ->reset();
}