public $_orderBy = NULL;
public $_orderByFields = array();
public $_orderByArray = array();
+ /**
+ * Array of clauses to group by.
+ *
+ * @var array
+ */
+ protected $_groupByArray = array();
public $_groupBy = NULL;
public $_whereClauses = array();
public $_havingClauses = array();
* Build group by clause.
*/
public function groupBy() {
- $groupBys = array();
if (!empty($this->_params['group_bys']) &&
is_array($this->_params['group_bys'])
) {
if (array_key_exists('group_bys', $table)) {
foreach ($table['group_bys'] as $fieldName => $field) {
if (!empty($this->_params['group_bys'][$fieldName])) {
- $groupBys[] = $field['dbAlias'];
+ $this->_groupByArray[] = $field['dbAlias'];
}
}
}
}
}
- if (!empty($groupBys)) {
- $this->_groupBy = CRM_Contact_BAO_Query::getGroupByFromSelectColumns($this->_selectClauses, $groupBys);
+ if (!empty($this->_groupByArray)) {
+ $this->_groupBy = CRM_Contact_BAO_Query::getGroupByFromSelectColumns($this->_selectClauses, $this->_groupByArray);
}
}