You are here

public function EntityQueryAlter::alter in Group 2.0.x

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

Alters the select query for the given entity type.

Parameters

\Drupal\Core\Database\Query\SelectInterface $query: The select query.

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type.

File

src/QueryAccess/EntityQueryAlter.php, line 149

Class

EntityQueryAlter
Defines a class for altering entity queries.

Namespace

Drupal\group\QueryAccess

Code

public function alter(SelectInterface $query, EntityTypeInterface $entity_type) {
  $this
    ->doAlter($query, $entity_type, $query
    ->getMetaData('op') ?: 'view');
  $this
    ->applyCacheability();
}