You are here

class CalculatedGroupPermissions in Group 2.0.x

Same name and namespace in other branches
  1. 8 src/Access/CalculatedGroupPermissions.php \Drupal\group\Access\CalculatedGroupPermissions

Represents a calculated set of group permissions with cacheable metadata.

Hierarchy

Expanded class hierarchy of CalculatedGroupPermissions

See also

\Drupal\group\Access\ChainGroupPermissionCalculator

2 files declare their use of CalculatedGroupPermissions
CalculatedGroupPermissionsTest.php in tests/src/Unit/CalculatedGroupPermissionsTest.php
ChainGroupPermissionCalculatorTest.php in tests/src/Kernel/ChainGroupPermissionCalculatorTest.php

File

src/Access/CalculatedGroupPermissions.php, line 12

Namespace

Drupal\group\Access
View source
class CalculatedGroupPermissions implements CalculatedGroupPermissionsInterface {
  use CacheableDependencyTrait;
  use CalculatedGroupPermissionsTrait;

  /**
   * Constructs a new CalculatedGroupPermissions.
   *
   * @param \Drupal\group\Access\CalculatedGroupPermissionsInterface $source
   *   The calculated group permission to create a value object from.
   */
  public function __construct(CalculatedGroupPermissionsInterface $source) {
    foreach ($source
      ->getItems() as $item) {
      $this->items[$item
        ->getScope()][$item
        ->getIdentifier()] = $item;
    }
    $this
      ->setCacheability($source);
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CacheableDependencyTrait::$cacheContexts protected property Cache contexts.
CacheableDependencyTrait::$cacheMaxAge protected property Cache max-age.
CacheableDependencyTrait::$cacheTags protected property Cache tags.
CacheableDependencyTrait::getCacheContexts public function 4
CacheableDependencyTrait::getCacheMaxAge public function 4
CacheableDependencyTrait::getCacheTags public function 4
CacheableDependencyTrait::setCacheability protected function Sets cacheability; useful for value object constructors.
CalculatedGroupPermissions::__construct public function Constructs a new CalculatedGroupPermissions.
CalculatedGroupPermissionsTrait::$items protected property A list of calculated group permission items, keyed by scope and identifier.
CalculatedGroupPermissionsTrait::getItem public function
CalculatedGroupPermissionsTrait::getItems public function
CalculatedGroupPermissionsTrait::getItemsByScope public function