Api docblock cleanup.
[civicrm-core.git] / api / v3 / Group.php
index 921e3ce97a177dc76bacdf502fb3a58fefa19cf2..59ab73fcf4f097135fcfe28a8fa65bba5c1200f5 100644 (file)
@@ -1,8 +1,7 @@
 <?php
-
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  */
 
 /**
- * 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
+ * Create/update group.
  *
- * This API is used to create new group or update any of the existing
- * In case of updating existing group, id of that particular group must
- * be in $params array. Either id or name is required field in the
- * $params array
+ * @param array $params
+ *   name/value pairs to insert in new 'group'
  *
- * @param array $params Associative array of property
- *                       name/value pairs to insert in new 'group'
- *
- * @return array  API result array
- *@example GroupCreate.php
- *{@getfields group_create}
- * @access public
+ * @return array
+ *   API result array
  */
 function civicrm_api3_group_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'Group');
 }
 
 /**
- * Adjust Metadata for Create action
+ * Adjust Metadata for Create action.
+ *
+ * The metadata is used for setting defaults, documentation & validation.
  *
- * The metadata is used for setting defaults, documentation & validation
- * @param array $params array or parameters determined by getfields
+ * @param array $params
+ *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_group_create_spec(&$params) {
   $params['is_active']['api.default'] = 1;
@@ -67,20 +61,17 @@ 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
+ * @param array $params
+ *   Array of properties. If empty, all records will be returned.
  *
- * @return array  Array of matching groups
- * @example GroupGet.php
- * {@getfields group_get}
- * @access public
+ * @return array
+ *   Array of matching groups
  */
 function civicrm_api3_group_get($params) {
   $options = _civicrm_api3_get_options_from_params($params, TRUE, 'group', 'get');
-  if(empty($options['return']) || !in_array('member_count', $options['return'])) {
+  if (empty($options['return']) || !in_array('member_count', $options['return'])) {
     return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params, TRUE, 'Group');
   }
 
@@ -92,23 +83,16 @@ function civicrm_api3_group_get($params) {
 }
 
 /**
- * delete an existing group
+ * Delete an existing group.
  *
- * This method is used to delete any existing group. id of the group
- * to be deleted is required field in $params array
+ * @param array $params
+ *   [id]
  *
- * @param array $params array containing id of the group
- *                       to be deleted
- *
- * @return array API result array
- *@example GroupDelete.php
- *{@getfields group_delete}
- *
- * @access public
+ * @return array
+ *   API result array
  */
 function civicrm_api3_group_delete($params) {
 
   CRM_Contact_BAO_Group::discard($params['id']);
   return civicrm_api3_create_success(TRUE);
 }
-