3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
14 * This api exposes CiviCRM price set fields.
16 * PriceSets contain PriceFields, which may contain PriceFieldValues.
17 * Each has its own api.
18 * Use chaining to create a PriceSet and associated PriceFields and values in one api call.
20 * @package CiviCRM_APIv3
24 * Create or update a price_field.
26 * @param array $params
27 * name/value pairs to insert in new 'price_field'
32 function civicrm_api3_price_field_create($params) {
33 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params, 'PriceField');
37 * Adjust Metadata for Create action.
39 * The metadata is used for setting defaults, documentation & validation.
41 * @param array $params
42 * Array of parameters determined by getfields.
44 function _civicrm_api3_price_field_create_spec(&$params) {
45 $params['label']['api.required'] = TRUE;
49 * Returns array of price_fields matching a set of one or more group properties.
51 * @param array $params
52 * Array of one or more valid property_name=>value pairs. If $params is set.
53 * as null, all price_fields will be returned (default limit is 25)
56 * Array of matching price_fields
58 function civicrm_api3_price_field_get($params) {
59 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__
), $params);
63 * Delete an existing price_field.
65 * This method is used to delete any existing price_field given its id.
67 * @param array $params
68 * Array containing id of the group to be deleted.
73 function civicrm_api3_price_field_delete($params) {
74 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__
), $params);