Merge pull request #6251 from LevityNL/master
[civicrm-core.git] / api / v3 / CustomGroup.php
index 285a6c9ccad169df3e33a6f93ecc649dbcbbc098..97c783af43f82f8cf3b5b9d2433a740c84fd6571 100644 (file)
@@ -1,10 +1,9 @@
 <?php
-
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | 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 custom group functions
+ * This api exposes CiviCRM custom group.
  *
  * @package CiviCRM_APIv3
- * @subpackage API_CustomGroup
- *
- * @copyright CiviCRM LLC (c) 2004-2014
- * @version $Id: CustomGroup.php 30879 2010-11-22 15:45:55Z shot $
  */
 
 /**
- * Most API functions take in associative arrays ( name => value pairs
- * as parameters. Some of the most commonly used parameters are
- * described below
- *
- * @param array $params           an associative array used in construction
- * retrieval of the object
- * @todo missing get function
+ * Use this API to create a new group.
  *
- *
- */
-
-/**
- * Use this API to create a new group.  The 'extends' value accepts an array or a comma separated string.
+ * The 'extends' value accepts an array or a comma separated string.
  * e.g array(
  'Individual','Contact') or 'Individual,Contact'
* 'Individual','Contact') or 'Individual,Contact'
  * See the CRM Data Model for custom_group property definitions
  * $params['class_name'] is a required field, class being extended.
  *
- * @param $params     array   Associative array of property name/value pairs to insert in group.
- * {@getfields CustomGroup_create}
+ * @param array $params
+ *   Array per getfields metadata.
  *
- * @return   Newly create custom_group object
+ * @return array
  * @todo $params['extends'] is array format - is that std compatible
- * @access public
  */
 function civicrm_api3_custom_group_create($params) {
   if (isset($params['extends']) && is_string($params['extends'])) {
@@ -80,9 +64,10 @@ function civicrm_api3_custom_group_create($params) {
 }
 
 /**
- * Adjust Metadata for Create action
+ * Adjust Metadata for Create action.
  *
- * @param array $params array or parameters determined by getfields
+ * @param array $params
+ *   Array of parameters determined by getfields.
  */
 function _civicrm_api3_custom_group_create_spec(&$params) {
   $params['extends']['api.required'] = 1;
@@ -94,15 +79,11 @@ function _civicrm_api3_custom_group_create_spec(&$params) {
 /**
  * Use this API to delete an existing group.
  *
- * @param array id of the group to be deleted
+ * @param array $params
  *
- * @return Null if success
- * @access public
- * {@getfields CustomGroup_delete}
- * @example CustomGroupDelete.php
- **/
+ * @return array
+ */
 function civicrm_api3_custom_group_delete($params) {
-
   $values = new CRM_Core_DAO_CustomGroup();
   $values->id = $params['id'];
   $values->find(TRUE);
@@ -112,25 +93,28 @@ function civicrm_api3_custom_group_delete($params) {
 }
 
 /**
- * Use this API to get existing custom fields.
+ * API to get existing custom fields.
  *
- * @param array $params Array to search on
+ * @param array $params
+ *   Array per getfields metadata.
  *
  * @return array
- * @access public
- * {@getfields CustomGroup_get}
- * @example CustomGroupGet.php
- **/
+ */
 function civicrm_api3_custom_group_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
 
 /**
- * CRM-15191 - Hack to ensure the cache gets cleared after updating a custom group
+ * CRM-15191 - Hack to ensure the cache gets cleared after updating a custom group.
+ *
+ * @param array $params
+ *   Array per getfields metadata.
+ *
+ * @return array
  */
 function civicrm_api3_custom_group_setvalue($params) {
   require_once 'api/v3/Generic/Setvalue.php';
-  $result = civicrm_api3_generic_setValue(array("entity" => 'custom_group', 'params' => $params));
+  $result = civicrm_api3_generic_setValue(array("entity" => 'CustomGroup', 'params' => $params));
   if (empty($result['is_error'])) {
     CRM_Utils_System::flushCache();
   }