*/
public function groupBy() {
$groupBys = array();
- if (is_array($this->_params['group_bys']) &&
- !empty($this->_params['group_bys'])
+ if (!empty($this->_params['group_bys']) &&
+ is_array($this->_params['group_bys'])
) {
foreach ($this->_columns as $tableName => $table) {
if (array_key_exists('group_bys', $table)) {
$this->_whereClauses[] = "{$this->_aliases['civicrm_participant']}.is_test = 0";
}
- // We override this function because we use GROUP functions in the
- // SELECT clause, therefore we have to group by *something*. If the
- // user doesn't select a column to group by, we should group by
- // participant id.
public function groupBy() {
+ // We override this function because we use GROUP functions in the
+ // SELECT clause, therefore we have to group by *something*. If the
+ // user doesn't select a column to group by, we should group by participant id.
parent::groupBy();
- if(empty($this->_groupBy)) {
+ if (empty($this->_groupBy)) {
$this->_groupBy = "GROUP BY {$this->_aliases['civicrm_participant']}.id";
}
}