Merge pull request #7336 from eileenmcnaughton/CRM-17636
[civicrm-core.git] / api / v3 / CustomValue.php
index f7ef22ff9a5fbcd67f863903a5d98198aeec8c2c..6c7565234f820db7a5b9a0a5ebad90d2218b217a 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
@@ -102,7 +102,7 @@ function civicrm_api3_custom_value_create($params) {
   if ($result['is_error']) {
     throw new Exception($result['error_message']);
   }
-  return civicrm_api3_create_success(TRUE, $params);
+  return civicrm_api3_create_success(TRUE, $params, 'CustomValue');
 }
 
 /**
@@ -169,7 +169,7 @@ function civicrm_api3_custom_value_get($params) {
   if ($result['is_error']) {
     if ($result['error_message'] == "No values found for the specified entity ID and custom field(s).") {
       $values = array();
-      return civicrm_api3_create_success($values, $params);
+      return civicrm_api3_create_success($values, $params, 'CustomValue');
     }
     else {
       throw new API_Exception($result['error_message']);
@@ -210,14 +210,14 @@ function civicrm_api3_custom_value_get($params) {
       }
       $values[$id]['entity_id'] = $getParams['entityID'];
       if (!empty($getParams['entityType'])) {
-        $values[$n]['entity_table'] = $getParams['entityType'];
+        $values[$id]['entity_table'] = $getParams['entityType'];
       }
       //set 'latest' -useful for multi fields but set for single for consistency
       $values[$id]['latest'] = $value;
       $values[$id]['id'] = $id;
       $values[$id][$n] = $value;
     }
-    return civicrm_api3_create_success($values, $params);
+    return civicrm_api3_create_success($values, $params, 'CustomValue');
   }
 }