X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FBAO%2FGroupContact.php;h=b7d75d17cfc8a80f6a3a2da9af9004a70f0e9ff0;hb=b5d05fb5666d5e303eaf23611c41efa5c43d0168;hp=0c1425ca060e353c580e69c09007cafd67373216;hpb=55039e98512c204e7919bd586b9e99ab176e51ea;p=civicrm-core.git diff --git a/CRM/Contact/BAO/GroupContact.php b/CRM/Contact/BAO/GroupContact.php index 0c1425ca06..b7d75d17cf 100644 --- a/CRM/Contact/BAO/GroupContact.php +++ b/CRM/Contact/BAO/GroupContact.php @@ -334,7 +334,8 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact { $count = FALSE, $ignorePermission = FALSE, $onlyPublicGroups = FALSE, - $excludeHidden = TRUE + $excludeHidden = TRUE, + $groupId = NULL ) { if ($count) { $select = 'SELECT count(DISTINCT civicrm_group_contact.id)'; @@ -362,6 +363,10 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact { $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,