function AccessPolicyProcessor::needsPersistentCache

Returns whether the persistent cache is necessary.

Return value

bool TRUE if cache should be used (at least one policy requires cache), FALSE if not.

1 call to AccessPolicyProcessor::needsPersistentCache()
AccessPolicyProcessor::processAccessPolicies in core/lib/Drupal/Core/Session/AccessPolicyProcessor.php
Processes the access policies for an account within a given scope.

File

core/lib/Drupal/Core/Session/AccessPolicyProcessor.php, line 213

Class

AccessPolicyProcessor
Processes access policies into permissions for an account.

Namespace

Drupal\Core\Session

Code

protected function needsPersistentCache() : bool {
    foreach ($this->accessPolicies as $access_policy) {
        if (!$access_policy instanceof CacheOptionalInterface) {
            return TRUE;
        }
    }
    return FALSE;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.