You are here

public function UserCacheContextBase::__construct in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Cache/Context/UserCacheContextBase.php \Drupal\Core\Cache\Context\UserCacheContextBase::__construct()
  2. 9 core/lib/Drupal/Core/Cache/Context/UserCacheContextBase.php \Drupal\Core\Cache\Context\UserCacheContextBase::__construct()

Constructs a new UserCacheContextBase class.

Parameters

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

1 method overrides UserCacheContextBase::__construct()
AccountPermissionsCacheContext::__construct in core/lib/Drupal/Core/Cache/Context/AccountPermissionsCacheContext.php
Constructs a new UserCacheContext service.

File

core/lib/Drupal/Core/Cache/Context/UserCacheContextBase.php, line 29

Class

UserCacheContextBase
Base class for user-based cache contexts.

Namespace

Drupal\Core\Cache\Context

Code

public function __construct(AccountInterface $user) {
  $this->user = $user;
}