protected function aggregate(Aggregate $aggregate) { $sql = strtoupper($aggregate->getFunction()); $sql .= '('; if ($aggregate->isDistinct()) { $sql .= 'DISTINCT '; } $sql .= $this->columns($aggregate->getColumns()); $sql .= ')'; return $sql; }