Finish the query by adding fields, GROUP BY and range.
\Drupal\field_sql_storage\Entity\Query Returns the called object.
protected function finish() {
$this
->initializePager();
if ($this->range) {
$this->sqlQuery
->range($this->range['start'], $this->range['length']);
}
foreach ($this->sqlGroupBy as $field) {
$this->sqlQuery
->groupBy($field);
}
foreach ($this->sqlFields as $field) {
$this->sqlQuery
->addField($field[0], $field[1], isset($field[2]) ? $field[2] : NULL);
}
return $this;
}