protected EntityAccessControlHandler::setCache($access, $cid, $operation, $langcode, AccountInterface $account)
Statically caches whether the given user has access.
\Drupal\Core\Access\AccessResultInterface $access: The access result.
string $cid: Unique string identifier for the entity/operation, for example the entity UUID or a custom string.
string $operation: The entity operation. Usually one of 'view', 'update', 'create' or 'delete'.
string $langcode: The language code for which to check access.
\Drupal\Core\Session\AccountInterface $account: The user for which to check access.
\Drupal\Core\Access\AccessResultInterface Whether the user has access, plus cacheability metadata.
protected function setCache($access, $cid, $operation, $langcode, AccountInterface $account) { // Save the given value in the static cache and directly return it. return $this->accessCache[$account->id()][$cid][$langcode][$operation] = $access; }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!EntityAccessControlHandler.php/function/EntityAccessControlHandler::setCache/8.1.x