CRM-11856 - Update custom values when option values are modified
[civicrm-core.git] / api / v3 / Group.php
index 0bbc1640419dffb2dc0f76e50c685b57951e67b6..a5d7cfeb231af4c72448fba2800e3003cbc7f6da 100644 (file)
@@ -3,7 +3,7 @@
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  */
 
 /**
- * File for the CiviCRM APIv3 group functions
+ * This api exposes CiviCRM Groups.
+ *
+ * This api is for creating/deleting groups or fetching a list of existing groups.
+ * To add/remove contacts to a group, use the GroupContact api instead.
  *
  * @package CiviCRM_APIv3
- * @subpackage API_Group
- * @copyright CiviCRM LLC (c) 2004-2014
- * @version $Id: Group.php 30171 2010-10-14 09:11:27Z mover $
  */
 
 /**
  * Create/update group.
  *
  * @param array $params
- *   Associative array of property.
- *                       name/value pairs to insert in new 'group'
+ *   name/value pairs to insert in new 'Group'
  *
  * @return array
  *   API result array
@@ -54,7 +53,7 @@ function civicrm_api3_group_create($params) {
  * The metadata is used for setting defaults, documentation & validation.
  *
  * @param array $params
- *   Array or parameters determined by getfields.
+ *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_group_create_spec(&$params) {
   $params['is_active']['api.default'] = 1;
@@ -62,18 +61,16 @@ function _civicrm_api3_group_create_spec(&$params) {
 }
 
 /**
- * Returns array of groups matching a set of one or more group properties.
+ * Returns array of groups matching a set of one or more Group properties.
  *
  * @param array $params
- *   Array of one or more valid.
- *                       property_name=>value pairs. If $params is set
- *                       as null, all groups will be returned
+ *   Array of properties. If empty, all records will be returned.
  *
  * @return array
  *   Array of matching groups
  */
 function civicrm_api3_group_get($params) {
-  $options = _civicrm_api3_get_options_from_params($params, TRUE, 'group', 'get');
+  $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');
   }
@@ -82,15 +79,14 @@ function civicrm_api3_group_get($params) {
   foreach ($groups as $id => $group) {
     $groups[$id]['member_count'] = CRM_Contact_BAO_Group::memberCount($id);
   }
-  return civicrm_api3_create_success($groups, $params, 'group', 'get');
+  return civicrm_api3_create_success($groups, $params, 'Group', 'get');
 }
 
 /**
- * Delete an existing group.
+ * Delete an existing Group.
  *
  * @param array $params
- *   Array containing id of the group.
- *                       to be deleted
+ *   [id]
  *
  * @return array
  *   API result array