Commit | Line | Data |
---|---|---|
a9140b42 EM |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
a30c801b | 4 | | Copyright CiviCRM LLC. All rights reserved. | |
a9140b42 | 5 | | | |
a30c801b TO |
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 | | |
a9140b42 EM |
9 | +--------------------------------------------------------------------+ |
10 | */ | |
11 | ||
12 | /** | |
13 | * This api exposes CiviCRM premium products attached to contributions. | |
14 | * | |
15 | * Premiums are used as incentive gifts on contribution pages. | |
16 | * Use chaining to create a premium and related products in one api call. | |
17 | * | |
18 | * @package CiviCRM_APIv3 | |
19 | */ | |
20 | ||
21 | /** | |
22 | * Save a contribution product. | |
23 | * | |
24 | * @param array $params | |
25 | * | |
26 | * @throws API_Exception | |
27 | * @return array | |
28 | */ | |
29 | function civicrm_api3_contribution_product_create($params) { | |
a25b46e9 | 30 | return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'ContributionProduct'); |
a9140b42 EM |
31 | } |
32 | ||
33 | /** | |
34 | * Get a contribution product. | |
35 | * | |
36 | * @param array $params | |
37 | * | |
38 | * @return array | |
39 | * Array of retrieved product property values. | |
40 | */ | |
41 | function civicrm_api3_contribution_product_get($params) { | |
42 | return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); | |
43 | } | |
44 | ||
45 | /** | |
46 | * Delete a contribution product. | |
47 | * | |
48 | * @param array $params | |
49 | * | |
50 | * @throws API_Exception | |
51 | * @return array | |
52 | * Array of deleted values. | |
53 | */ | |
54 | function civicrm_api3_contribution_product_delete($params) { | |
55 | return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); | |
56 | } |