You are here

public function IsGroupMemberCacheContext::__construct in Group 8

Same name and namespace in other branches
  1. 2.0.x src/Cache/Context/IsGroupMemberCacheContext.php \Drupal\group\Cache\Context\IsGroupMemberCacheContext::__construct()

Constructs a new GroupMembershipPermissionsCacheContext class.

Parameters

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

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

\Drupal\group\GroupMembershipLoaderInterface $membership_loader: The group membership loader service.

File

src/Cache/Context/IsGroupMemberCacheContext.php, line 65

Class

IsGroupMemberCacheContext
Defines a cache context for "is a group member or not" caching.

Namespace

Drupal\group\Cache\Context

Code

public function __construct(AccountProxyInterface $current_user, EntityTypeManagerInterface $entity_type_manager, GroupMembershipLoaderInterface $membership_loader) {
  $this->currentUser = $current_user;
  $this->entityTypeManager = $entity_type_manager;
  $this->membershipLoader = $membership_loader;
}