You are here

public function QueryAggregate::execute in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/Query/Sql/QueryAggregate.php \Drupal\Core\Entity\Query\Sql\QueryAggregate::execute()

Execute the query.

Return value

int|array Returns an integer for count queries or an array of ids. The values of the array are always entity ids. The keys will be revision ids if the entity supports revision and entity ids if not.

Overrides Query::execute

File

core/lib/Drupal/Core/Entity/Query/Sql/QueryAggregate.php, line 28
Contains \Drupal\Core\Entity\Query\Sql\QueryAggregate.

Class

QueryAggregate
The SQL storage entity query aggregate class.

Namespace

Drupal\Core\Entity\Query\Sql

Code

public function execute() {
  return $this
    ->prepare()
    ->addAggregate()
    ->compile()
    ->compileAggregate()
    ->addGroupBy()
    ->addSort()
    ->addSortAggregate()
    ->finish()
    ->result();
}