/** * Builds the GROUP BY part * * @return string */ protected function _buildGroupByPart() { $sql = ''; if (count($this->_info['groupBy'])) { $sql = ' GROUP BY ' . implode(', ', $this->_info['groupBy']); if (count($this->_info['having'])) { $sql .= ' HAVING ' . $this->_query->_concatConditions($this->_info['having']); } } return $sql; }