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 +--------------------------------------------------------------------+
13 * This api exposes CiviCRM premium products.
15 * Premiums are used as incentive gifts on contribution pages.
16 * Use chaining to create a premium and related products in one api call.
18 * @package CiviCRM_APIv3
24 * @param array $params
26 * @throws API_Exception
29 function civicrm_api3_product_create($params) {
30 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params, 'Product');
34 * Adjust Metadata for Create action.
36 * The metadata is used for setting defaults, documentation & validation.
38 * @param array $params
39 * Array of parameters determined by getfields.
41 function _civicrm_api3_product_create_spec(&$params) {
42 $params['is_active']['api.default'] = 1;
43 $params['name']['api.required'] = 1;
49 * @param array $params
52 * Array of retrieved product property values.
54 function civicrm_api3_product_get($params) {
55 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__
), $params);
61 * @param array $params
63 * @throws API_Exception
65 * Array of deleted values.
67 function civicrm_api3_product_delete($params) {
68 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__
), $params);