protected function EntityQueryAlter::applyCacheability in Group 8
Same name and namespace in other branches
- 2.0.x src/QueryAccess/EntityQueryAlter.php \Drupal\group\QueryAccess\EntityQueryAlter::applyCacheability()
Applies the cacheablity metadata to the current request.
1 call to EntityQueryAlter::applyCacheability()
- EntityQueryAlter::alter in src/
QueryAccess/ EntityQueryAlter.php - Alters the select query for the given entity type.
File
- src/
QueryAccess/ EntityQueryAlter.php, line 549
Class
- EntityQueryAlter
- Defines a class for altering entity queries.
Namespace
Drupal\group\QueryAccessCode
protected function applyCacheability() {
$request = $this->requestStack
->getCurrentRequest();
if ($request
->isMethodCacheable() && $this->renderer
->hasRenderContext() && $this
->hasCacheableMetadata()) {
$build = [];
$this->cacheableMetadata
->applyTo($build);
$this->renderer
->render($build);
}
}