Mercurial > hg > isophonics-drupal-site
comparison core/modules/workspaces/src/EntityQuery/QueryAggregate.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
1 <?php | |
2 | |
3 namespace Drupal\workspaces\EntityQuery; | |
4 | |
5 use Drupal\Core\Entity\Query\Sql\QueryAggregate as BaseQueryAggregate; | |
6 | |
7 /** | |
8 * Alters aggregate entity queries to use a workspace revision if possible. | |
9 */ | |
10 class QueryAggregate extends BaseQueryAggregate { | |
11 | |
12 use QueryTrait { | |
13 prepare as traitPrepare; | |
14 } | |
15 | |
16 /** | |
17 * {@inheritdoc} | |
18 */ | |
19 public function prepare() { | |
20 // Aggregate entity queries do not return an array of entity IDs keyed by | |
21 // revision IDs, they only return the values of the aggregated fields, so we | |
22 // don't need to add any expressions like we do in | |
23 // \Drupal\workspaces\EntityQuery\Query::prepare(). | |
24 $this->traitPrepare(); | |
25 | |
26 // Throw away the ID fields. | |
27 $this->sqlFields = []; | |
28 return $this; | |
29 } | |
30 | |
31 } |