/*
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
/**
* Create or update a price_field_value
*
- * @param array $params Associative array of property
+ * @param array $params
+ * Associative array of property.
* name/value pairs to insert in new 'price_field_value'
* @example PriceFieldValueCreate.php Std Create example
*
*/
function civicrm_api3_price_field_value_create($params) {
$ids = array();
- if(!empty($params['id'])){
+ if (!empty($params['id'])) {
$ids['id'] = $params['id'];
}
* Adjust Metadata for Create action
*
* The metadata is used for setting defaults, documentation & validation
- * @param array $params array or parameters determined by getfields
+ * @param array $params
+ * Array or parameters determined by getfields.
*/
function _civicrm_api3_price_field_value_create_spec(&$params) {
$params['price_field_id']['api.required'] = TRUE;
$params['label']['api.required'] = TRUE;
+ $params['amount']['api.required'] = TRUE;
+ $params['is_active']['api.default'] = TRUE;
}
/**
* Returns array of price_field_values 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
+ * @param array $params
+ * Array of one or more valid property_name=>value pairs. If $params is set.
* as null, all price_field_values will be returned (default limit is 25)
*
* @return array Array of matching price_field_values
* This method is used to delete any existing price_field_value. id of the group
* to be deleted is required field in $params array
*
- * @param array $params array containing id of the group
+ * @param array $params
+ * Array containing id of the group.
* to be deleted
*
- * @return array returns flag true if successfull, error message otherwise
+ * @return array API result array
* {@getfields price_field_value_delete}
* @access public
*/