function QueryAggregate::addSortAggregate

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/Query/Sql/QueryAggregate.php \Drupal\Core\Entity\Query\Sql\QueryAggregate::addSortAggregate()
  2. 8.9.x core/lib/Drupal/Core/Entity/Query/Sql/QueryAggregate.php \Drupal\Core\Entity\Query\Sql\QueryAggregate::addSortAggregate()
  3. 11.x core/lib/Drupal/Core/Entity/Query/Sql/QueryAggregate.php \Drupal\Core\Entity\Query\Sql\QueryAggregate::addSortAggregate()

Builds the aggregation sort part of the query.

Return value

$this Returns the called object.

File

core/lib/Drupal/Core/Entity/Query/Sql/QueryAggregate.php, line 120

Class

QueryAggregate
The SQL storage entity query aggregate class.

Namespace

Drupal\Core\Entity\Query\Sql

Code

protected function addSortAggregate() {
    if (!$this->count) {
        foreach ($this->sortAggregate as $alias => $sort) {
            $this->sqlQuery
                ->orderBy($alias, $sort['direction']);
        }
    }
    return $this;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.