Merge remote-tracking branch 'origin/4.5' into 4.5-master-2015-02-24-17-24-05
[civicrm-core.git] / api / v3 / UFGroup.php
index 1e9cff919e6d4a789b339075aa2f2261d832cbcb..209fcada12c88d7ca3bfa19eca4e62967ce85146 100644 (file)
@@ -1,8 +1,7 @@
 <?php
-
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
- * File for the CiviCRM APIv3 user framework group functions
+ * This api exposes CiviCRM profile group.
  *
  * @package CiviCRM_APIv3
- * @subpackage API_UF
- *
- * @copyright CiviCRM LLC (c) 2004-2014
- * @version $Id: UFGroup.php 30171 2010-10-14 09:11:27Z mover $
- *
  */
 
 /**
- * Files required for this package
+ * Adjust metadata for create action.
+ *
+ * @param array $params
  */
 function _civicrm_api3_uf_group_create_spec(&$params) {
   $session = CRM_Core_Session::singleton();
   $params['title']['api.required'] = 1;
   $params['is_active']['api.default'] = 1;
   $params['is_update_dupe']['api.default'] = 1;
-  $params['created_id']['api.default'] = 'user_contact_id';//the current user
+  // Default to the logged in user.
+  $params['created_id']['api.default'] = 'user_contact_id';
   $params['created_date']['api.default'] = 'now';
 }
+
 /**
- * Use this API to create a new group. See the CRM Data Model for uf_group property definitions
+ * Use this API to create a new group.
+ *
+ * See the CRM Data Model for uf_group property definitions
  *
- * @param $params  array   Associative array of property name/value pairs to insert in group.
+ * @param array $params
+ *   Array per getfields metadata.
  *
- * @return array API result array
- * {@getfields UFGroup_create}
- * @example UFGroupCreate.php
- * @access public
+ * @return array
+ *   API result array
  */
 function civicrm_api3_uf_group_create($params) {
   return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- * Returns array of uf groups (profiles)  matching a set of one or more group properties
+ * Returns array of uf groups (profiles) matching a set of one or more group properties.
  *
- * @param array $params  (reference) Array of one or more valid
- *                       property_name=>value pairs. If $params is set
- *                       as null, all surveys will be returned
+ * @param array $params
+ *   Array of properties. If empty, all records will be returned.
  *
- * @return array   Array of matching profiles
- * {@getfields UFGroup_get}
- * @example UFGroupGet.php
- * @access public
+ * @return array
+ *   Array of matching profiles
  */
 function civicrm_api3_uf_group_get($params) {
 
@@ -80,17 +76,12 @@ function civicrm_api3_uf_group_get($params) {
 }
 
 /**
- * Delete uf group
+ * Delete uf group.
  *
  * @param array $params
  *
- *
- * @return true on successful delete or return error
- * @access public
- * {@getfields UFGroup_delete}
- * @example UFGroupDelete.php
+ * @return array
  */
 function civicrm_api3_uf_group_delete($params) {
   return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
-