setDefaultWhereClause(); $this->expandSelectClauseWildcards(); $result->exchangeArray($this->getObjects()); } /** * @return array|int */ protected function getObjects() { $query = new Api4SelectQuery($this); $result = $query->run(); if (is_array($result)) { \CRM_Utils_API_HTMLInputCoder::singleton()->decodeRows($result); } return $result; } /** * @return array */ public function getGroupBy(): array { return $this->groupBy; } /** * @param array $groupBy * @return $this */ public function setGroupBy(array $groupBy) { $this->groupBy = $groupBy; return $this; } /** * @param string $field * @return $this */ public function addGroupBy(string $field) { $this->groupBy[] = $field; return $this; } }