You are here

public function AccessResultCache::setAccessResultsCache in Permissions by Term 8.2

File

src/Cache/AccessResultCache.php, line 23

Class

AccessResultCache

Namespace

Drupal\permissions_by_term\Cache

Code

public function setAccessResultsCache(int $accountId, $entityId, AccessResult $accessResult) : void {
  $data = \serialize($accessResult);
  $cid = 'permissions_by_term:access_result_cache:' . $entityId . ':' . $accountId;
  $tags = [
    'permissions_by_term:access_result_cache:' . $entityId . ':' . $accountId,
    'permissions_by_term:access_result_cache:' . $entityId,
    'permissions_by_term:access_result_cache',
  ];
  $tags = Cache::mergeTags($tags, [
    $cid,
  ]);
  $this->cache
    ->set($cid, $data, Cache::PERMANENT, $tags);
  $staticCache =& drupal_static(__FUNCTION__ . $cid, NULL);
  $staticCache = $data;
}