-
- $options = _civicrm_api3_get_options_from_params($params, TRUE, 'get');
- $sort = CRM_Utils_Array::value('sort', $options, NULL);
- $offset = CRM_Utils_Array::value('offset', $options);
- $rowCount = CRM_Utils_Array::value('limit', $options);
- $returnProperties = CRM_Utils_Array::value('return', $options, NULL);
- $inputParams = CRM_Utils_Array::value('input_params', $options, array());
- if(is_array($returnProperties) && !empty($returnProperties)){
- // group function takes $returnProperties in non standard format & doesn't add id
- $returnProperties['id'] = 1;
- $returnProperties = array_keys($returnProperties);
- }
- $groupObjects = CRM_Contact_BAO_Group::getGroups($inputParams, $returnProperties, $sort, $offset, $rowCount);
- if (empty($groupObjects)) {
- return civicrm_api3_create_success(FALSE);
+ $options = _civicrm_api3_get_options_from_params($params, TRUE, 'group', 'get');
+ if(empty($options['return']) || !in_array('member_count', $options['return'])) {
+ return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, TRUE, 'Group');