protected function buildQueryEnd()
{
$return = '';
if ($this->group) {
$return .= ' GROUP BY ' . $this->group;
}
if ($this->having) {
$return .= ' HAVING ' . $this->having;
}
if ($this->order) {
$return .= ' ORDER BY ' . implode(', ', $this->order);
}
return $return;
}