+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
+ | Copyright CiviCRM LLC (c) 2004-2015 |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
*/
/**
- * This api exposes CiviCRM group contacts.
+ * This api exposes CiviCRM GroupContact records.
*
* This api is for adding/removing contacts from a group,
* or fetching a list of groups for a contact.
*
* Important note: This api does not fetch smart groups for a contact.
- * To fetch all contacts in a smart group, use the contact api
+ * To fetch all contacts in a smart group, use the Contact api
* passing a contact_id and group_id.
*
* To create/delete groups, use the group api instead.
* @package CiviCRM_APIv3
*/
-
/**
- * This API will give list of the groups for particular contact.
+ * Fetch a list of groups for a contact, or contacts for a group.
*
- * Particular status can be sent in params array.
+ * @Note: this only applies to static groups, not smart groups.
+ * To fetch all contacts in a smart group, use the Contact api
+ * passing a contact_id and group_id.
*
* If no status mentioned in params, by default 'added' will be used
* to fetch the records
$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);
+ return civicrm_api3_create_success($values, $params, 'GroupContact');
}
/**
$extraReturnValues['not_removed'] += $nr;
}
}
- $dao = NULL;// can't pass this by reference
- return civicrm_api3_create_success(1, $params, 'group_contact', 'create', $dao, $extraReturnValues);
+ // can't pass this by reference
+ $dao = NULL;
+ return civicrm_api3_create_success(1, $params, 'GroupContact', 'create', $dao, $extraReturnValues);
}
/**