annotate core/modules/workspaces/src/EntityQuery/QueryAggregate.php @ 19:fa3358dc1485 tip

Add ndrum files
author Chris Cannam
date Wed, 28 Aug 2019 13:14:47 +0100
parents 129ea1e6d783
children
rev   line source
Chris@17 1 <?php
Chris@17 2
Chris@17 3 namespace Drupal\workspaces\EntityQuery;
Chris@17 4
Chris@17 5 use Drupal\Core\Entity\Query\Sql\QueryAggregate as BaseQueryAggregate;
Chris@17 6
Chris@17 7 /**
Chris@17 8 * Alters aggregate entity queries to use a workspace revision if possible.
Chris@17 9 */
Chris@17 10 class QueryAggregate extends BaseQueryAggregate {
Chris@17 11
Chris@17 12 use QueryTrait {
Chris@17 13 prepare as traitPrepare;
Chris@17 14 }
Chris@17 15
Chris@17 16 /**
Chris@17 17 * {@inheritdoc}
Chris@17 18 */
Chris@17 19 public function prepare() {
Chris@17 20 // Aggregate entity queries do not return an array of entity IDs keyed by
Chris@17 21 // revision IDs, they only return the values of the aggregated fields, so we
Chris@17 22 // don't need to add any expressions like we do in
Chris@17 23 // \Drupal\workspaces\EntityQuery\Query::prepare().
Chris@17 24 $this->traitPrepare();
Chris@17 25
Chris@17 26 // Throw away the ID fields.
Chris@17 27 $this->sqlFields = [];
Chris@17 28 return $this;
Chris@17 29 }
Chris@17 30
Chris@17 31 }