trait CalculatedGroupPermissionsTrait in Group 8
Same name and namespace in other branches
- 2.0.x src/Access/CalculatedGroupPermissionsTrait.php \Drupal\group\Access\CalculatedGroupPermissionsTrait
Trait for \Drupal\group\Access\CalculatedGroupPermissionsInterface.
Hierarchy
- trait \Drupal\group\Access\CalculatedGroupPermissionsTrait
File
- src/
Access/ CalculatedGroupPermissionsTrait.php, line 8
Namespace
Drupal\group\AccessView source
trait CalculatedGroupPermissionsTrait {
/**
* A list of calculated group permission items, keyed by scope and identifier.
*
* @var array
*/
protected $items = [];
/**
* {@inheritdoc}
*/
public function getItem($scope, $identifier) {
return isset($this->items[$scope][$identifier]) ? $this->items[$scope][$identifier] : FALSE;
}
/**
* {@inheritdoc}
*/
public function getItems() {
$items = [];
foreach ($this->items as $scope_items) {
foreach ($scope_items as $item) {
$items[] = $item;
}
}
return $items;
}
/**
* {@inheritdoc}
*/
public function getItemsByScope($scope) {
return isset($this->items[$scope]) ? array_values($this->items[$scope]) : [];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CalculatedGroupPermissionsTrait:: |
protected | property | A list of calculated group permission items, keyed by scope and identifier. | |
CalculatedGroupPermissionsTrait:: |
public | function | ||
CalculatedGroupPermissionsTrait:: |
public | function | ||
CalculatedGroupPermissionsTrait:: |
public | function |