protected function _compile_group_by()
{
if (count($this->qb_groupby) > 0) {
for ($i = 0, $c = count($this->qb_groupby); $i < $c; $i++) {
// Is it already compiled?
if (is_string($this->qb_groupby[$i])) {
continue;
}
$this->qb_groupby[$i] = ($this->qb_groupby[$i]['escape'] === FALSE or $this->_is_literal($this->qb_groupby[$i]['field'])) ? $this->qb_groupby[$i]['field'] : $this->protect_identifiers($this->qb_groupby[$i]['field']);
}
return "\nGROUP BY " . implode(', ', $this->qb_groupby);
}
return '';
}