class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
/**
- * class constructor
+ * Class constructor
*/
function __construct() {
parent::__construct();
}
/**
- * takes an associative array and creates a groupContact object
+ * Takes an associative array and creates a groupContact object
*
* the function extract all the params it needs to initialize the create a
* group object. the params array could contain additional unused name/value
}
/**
- * get list of all the groups and groups for a contact
+ * Get list of all the groups and groups for a contact
*
* @param int $contactId contact id
*
}
/**
- * get the list of groups for contact based on status of group membership
+ * Get the list of groups for contact based on status of group membership
*
* @param int $contactId contact id
* @param string $status state of membership
$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,
}
/**
- * takes an associative array and creates / removes
+ * Takes an associative array and creates / removes
* contacts from the groups
*
*
}
/**
- * @param $contactID
- * @param $groupID
+ * @param int $contactID
+ * @param int $groupID
*
* @return bool
*/