You are here

protected function EntityQueryAlter::hasCacheableMetadata in Group 2.0.x

Same name and namespace in other branches
  1. 8 src/QueryAccess/EntityQueryAlter.php \Drupal\group\QueryAccess\EntityQueryAlter::hasCacheableMetadata()

Check if the cacheable metadata is not empty.

An empty cacheable metadata object has no context, tags, and is permanent.

Return value

bool TRUE if there is cacheability metadata, otherwise FALSE.

1 call to EntityQueryAlter::hasCacheableMetadata()
EntityQueryAlter::applyCacheability in src/QueryAccess/EntityQueryAlter.php
Applies the cacheablity metadata to the current request.

File

src/QueryAccess/EntityQueryAlter.php, line 557

Class

EntityQueryAlter
Defines a class for altering entity queries.

Namespace

Drupal\group\QueryAccess

Code

protected function hasCacheableMetadata() {
  return $this->cacheableMetadata
    ->getCacheMaxAge() !== Cache::PERMANENT || count($this->cacheableMetadata
    ->getCacheContexts()) > 0 || count($this->cacheableMetadata
    ->getCacheTags()) > 0;
}