$count = FALSE,
$ignorePermission = FALSE,
$onlyPublicGroups = FALSE,
- $excludeHidden = TRUE
+ $excludeHidden = TRUE,
+ $groupId = NULL
) {
if ($count) {
$select = 'SELECT count(DISTINCT civicrm_group_contact.id)';
$where .= ' AND civicrm_group_contact.status = %2';
$params[2] = array($status, 'String');
}
+ if (!empty($groupId)) {
+ $where .= " AND civicrm_group.id = %3 ";
+ $params[3] = array($groupId, 'Integer');
+ }
$tables = array(
'civicrm_group_contact' => 1,
'civicrm_group' => 1,
}
$status = CRM_Utils_Array::value('status', $params, 'Added');
- $values = &CRM_Contact_BAO_GroupContact::getContactGroup($params['contact_id'], $status, NULL, FALSE, TRUE);
+ $groupId = CRM_Utils_Array::value('group_id', $params);
+ $values = &CRM_Contact_BAO_GroupContact::getContactGroup($params['contact_id'], $status, NULL, FALSE, TRUE, FALSE, TRUE, $groupId);
return civicrm_api3_create_success($values, $params);
}