Merge pull request #7336 from eileenmcnaughton/CRM-17636
[civicrm-core.git] / api / v3 / PriceFieldValue.php
index a22cf7b3e33e224ca91a88d5bc33a031cba12bbe..4c9a803f009d56509c0507fd9619bdf522fca669 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.                                    |
  |                                                                    |
 
 
 /**
- * This api exposes CiviCRM price sets.
+ * This api exposes CiviCRM price field values.
+ *
+ * PriceFields may contain zero or more PriceFieldValues.
+ * Use chaining to create PriceFields and values in one api call.
  *
  * @package CiviCRM_APIv3
  */
 
 /**
- * Create or update a price_field_value.
+ * Create or update a PriceFieldValue.
  *
  * @param array $params
- *   name/value pairs to insert in new 'price_field_value'
+ *   name/value pairs to insert in new 'PriceFieldValue'
  *
  * @return array
  *   API result array.
@@ -51,7 +54,7 @@ function civicrm_api3_price_field_value_create($params) {
 
   $values = array();
   _civicrm_api3_object_to_array($bao, $values[$bao->id]);
-  return civicrm_api3_create_success($values, $params, 'price_field_value', 'create', $bao);
+  return civicrm_api3_create_success($values, $params, 'PriceFieldValue', 'create', $bao);
 
 }
 
@@ -68,10 +71,11 @@ function _civicrm_api3_price_field_value_create_spec(&$params) {
   $params['label']['api.required'] = TRUE;
   $params['amount']['api.required'] = TRUE;
   $params['is_active']['api.default'] = TRUE;
+  $params['financial_type_id']['api.default'] = TRUE;
 }
 
 /**
- * Returns array of price_field_values  matching a set of one or more group properties.
+ * Returns array of PriceFieldValues  matching a set of one or more group properties.
  *
  * @param array $params
  *   Array of one or more valid property_name=>value pairs. If $params is set.
@@ -85,10 +89,9 @@ function civicrm_api3_price_field_value_get($params) {
 }
 
 /**
- * Delete an existing price_field_value.
+ * Delete an existing PriceFieldValue.
  *
- * This method is used to delete any existing price_field_value. id of the group
- * to be deleted is required field in $params array
+ * This method is used to delete any existing PriceFieldValue given its id.
  *
  * @param array $params
  *   Array containing id of the group to be deleted.