INFRA-132 - Batch 14 (g)
[civicrm-core.git] / api / v3 / CustomField.php
index 56a416c41ddb0a2ccd1b432edeef80b60756906e..c207e48457294ccee2c3a8693fac264a0c113453 100644 (file)
@@ -1,5 +1,4 @@
 <?php
-
 /*
  +--------------------------------------------------------------------+
  | CiviCRM version 4.6                                                |
  * @version $Id: CustomField.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
- *
- */
-
 /**
  * Create a 'custom field' within a custom field group.
  * We also empty the static var in the getfields
  * function after deletion so that the field is available for us (getfields manages date conversion
  * among other things
  *
- * @param $params
+ * @param array $params
  *   Array Associative array of property name/value pairs to create new custom field.
  *
- * @return Newly API success object
- *
- * @access public
- *
- * @example CustomFieldCreate.php
- * {@getfields CustomField_create}
- * {@example CustomFieldCreate.php 0}
- *
+ * @return array
+ *   API success array
  */
 function civicrm_api3_custom_field_create($params) {
 
@@ -90,6 +72,7 @@ function _civicrm_api3_custom_field_flush_static_caches() {
   civicrm_api('custom_field', 'getfields', array('version' => 3, 'cache_clear' => 1));
   CRM_Core_BAO_UFField::getAvailableFieldsFlat(TRUE);
 }
+
 /**
  * Adjust Metadata for Create action
  *
@@ -112,18 +95,12 @@ function _civicrm_api3_custom_field_create_spec(&$params) {
 /**
  * Use this API to delete an existing custom group field.
  *
- * @param $params
+ * @param array $params
  *   Array id of the field to be deleted.
  *
  * @return array
- * @example CustomFieldDelete.php
- *
- * {@example CustomFieldDelete.php 0}
- * {@getfields CustomField_delete}
- * @access public
- **/
+ */
 function civicrm_api3_custom_field_delete($params) {
-
   $field = new CRM_Core_BAO_CustomField();
   $field->id = $params['id'];
   $field->find(TRUE);
@@ -137,13 +114,9 @@ function civicrm_api3_custom_field_delete($params) {
  *
  * @param array $params
  *   Array to search on.
- * {*
  *
  * @return array
-@getfields CustomField_get}
- * @access public
- *
- **/
+ */
 function civicrm_api3_custom_field_get($params) {
   return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
 }
@@ -161,13 +134,13 @@ function civicrm_api3_custom_field_get($params) {
  * @param array $errors
  *   Collect validation errors.
  *
- * @return array
  *   Validation errors
+ * @return array|NULL
+ *   Validation errors
  * @todo remove this function - not in use but need to review functionality before
  * removing as it might be useful in wrapper layer
  */
 function _civicrm_api3_custom_field_validate_field($fieldName, $value, $fieldDetails, &$errors = array()) {
-  return;
+  return NULL;
   //see comment block
   if (!$value) {
     return $errors;
@@ -274,6 +247,8 @@ SELECT count(*)
 
 /**
  * CRM-15191 - Hack to ensure the cache gets cleared after updating a custom field
+ * @param array $params
+ * @return array
  */
 function civicrm_api3_custom_field_setvalue($params) {
   require_once 'api/v3/Generic/Setvalue.php';