Commit | Line | Data |
---|---|---|
2893c4c4 J |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
a30c801b | 4 | | Copyright CiviCRM LLC. All rights reserved. | |
2893c4c4 | 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 | | |
2893c4c4 J |
9 | +--------------------------------------------------------------------+ |
10 | */ | |
11 | ||
12 | /** | |
13 | * This api exposes CiviCRM Status Preferences. | |
14 | * | |
15 | * @package CiviCRM_APIv3 | |
16 | */ | |
17 | ||
18 | /** | |
19 | * Save a Status Preference. | |
20 | * | |
21 | * @param array $params | |
22 | * | |
23 | * @return array | |
24 | */ | |
25 | function civicrm_api3_status_preference_create($params) { | |
1237d8d7 | 26 | return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'StatusPreference'); |
2893c4c4 J |
27 | } |
28 | ||
29 | /** | |
30 | * Get an Acl. | |
31 | * | |
32 | * @param array $params | |
33 | * | |
34 | * @return array | |
35 | * Array of retrieved Acl property values. | |
36 | */ | |
37 | function civicrm_api3_status_preference_get($params) { | |
38 | return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); | |
39 | } | |
40 | ||
41 | /** | |
42 | * Delete an Acl. | |
43 | * | |
44 | * @param array $params | |
45 | * | |
46 | * @return array | |
47 | * Array of deleted values. | |
48 | */ | |
49 | function civicrm_api3_status_preference_delete($params) { | |
50 | return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); | |
51 | } | |
abdc6572 J |
52 | |
53 | /** | |
54 | * Adjust Metadata for Create action. | |
55 | * | |
56 | * @param array $params | |
57 | * Array of parameters determined by getfields. | |
58 | */ | |
59 | function _civicrm_api3_status_preference_create_spec(&$params) { | |
60 | $params['name']['api.required'] = 1; | |
4796e223 | 61 | // Status Preference can be integer OR a string. |
a24a0be0 | 62 | $params['ignore_severity']['type'] = 2; |
abdc6572 | 63 | } |