"Fossies" - the Fresh Open Source Software Archive

Member "drupal-8.9.9/core/modules/workspaces/src/EntityQuery/QueryAggregate.php" (18 Nov 2020, 753 Bytes) of package /linux/www/drupal-8.9.9.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "QueryAggregate.php" see the Fossies "Dox" file reference documentation.

    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 }