Merge remote-tracking branch 'upstream/4.3' into 4.3-4.4-2013-10-28-14-52-15
[civicrm-core.git] / api / v3 / CustomValue.php
index fe025cdef541accf3391543b2d70df7876fff9f0..dde56fd8a72c372541aebb1b621dd5323330b5c9 100644 (file)
@@ -1,9 +1,8 @@
 <?php
-// $Id$
 
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.3                                                |
+ | CiviCRM version 4.4                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2013                                |
  +--------------------------------------------------------------------+
@@ -113,12 +112,13 @@ function civicrm_api3_custom_value_create($params) {
   }
   return civicrm_api3_create_success(TRUE, $params);
 }
-/*
+
+/**
  * Adjust Metadata for Create action
-*
-* The metadata is used for setting defaults, documentation & validation
-* @param array $params array or parameters determined by getfields
-*/
+ *
+ * The metadata is used for setting defaults, documentation & validation
+ * @param array $params array or parameters determined by getfields
+ */
 function _civicrm_api3_custom_value_create_spec(&$params) {
   $params['entity_id']['api.required'] = 1;
 }
@@ -136,8 +136,7 @@ function _civicrm_api3_custom_value_create_spec(&$params) {
  * @return array.
  *
  * @access public
- *
- **/
+ */
 function civicrm_api3_custom_value_get($params) {
 
   $getParams = array(
@@ -177,7 +176,7 @@ function civicrm_api3_custom_value_get($params) {
       return civicrm_api3_create_success($values, $params);
     }
     else {
-      return civicrm_api3_create_error($result['error_message']);
+      throw new API_Exception($result['error_message']);
     }
   }
   else {
@@ -225,12 +224,12 @@ function civicrm_api3_custom_value_get($params) {
   }
 }
 
-/*
+/**
  * Adjust Metadata for Get action
-*
-* The metadata is used for setting defaults, documentation & validation
-* @param array $params array or parameters determined by getfields
-*/
+ *
+ * The metadata is used for setting defaults, documentation & validation
+ * @param array $params array or parameters determined by getfields
+ */
 function _civicrm_api3_custom_value_get_spec(&$params) {
   $params['entity_id']['api.required'] = 1;
-}
\ No newline at end of file
+}