Commit | Line | Data |
---|---|---|
15d9b3ae | 1 | <?php |
15d9b3ae N |
2 | /* |
3 | +--------------------------------------------------------------------+ | |
a30c801b | 4 | | Copyright CiviCRM LLC. All rights reserved. | |
15d9b3ae | 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 | | |
15d9b3ae | 9 | +--------------------------------------------------------------------+ |
d25dd0ee | 10 | */ |
15d9b3ae N |
11 | |
12 | /** | |
c28e1768 | 13 | * This api exposes CiviCRM dashboard contacts. |
15d9b3ae N |
14 | * |
15 | * @package CiviCRM_APIv3 | |
15d9b3ae N |
16 | */ |
17 | ||
18 | /** | |
61fe4988 | 19 | * Creates/Updates a new Dashboard Contact Entry. |
15d9b3ae N |
20 | * |
21 | * @param array $params | |
22 | * | |
23 | * @return array | |
15d9b3ae N |
24 | */ |
25 | function civicrm_api3_dashboard_contact_create($params) { | |
a25b46e9 | 26 | return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params, 'DashboardContact'); |
15d9b3ae N |
27 | } |
28 | ||
29 | /** | |
2e66abf8 | 30 | * Gets a CiviCRM Dashlets of Contacts according to parameters. |
15d9b3ae | 31 | * |
cf470720 | 32 | * @param array $params |
2e66abf8 | 33 | * Array per getfields metadata. |
15d9b3ae N |
34 | * |
35 | * @return array | |
15d9b3ae N |
36 | */ |
37 | function civicrm_api3_dashboard_contact_get($params) { | |
dcf56200 | 38 | return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params); |
15d9b3ae N |
39 | } |
40 | ||
41 | /** | |
0aa0303c EM |
42 | * Adjust Metadata for Create action. |
43 | * | |
44 | * The metadata is used for setting defaults, documentation & validation. | |
15d9b3ae | 45 | * |
3a86ec51 CW |
46 | * @param array $fields |
47 | * Array of fields determined by getfields. | |
15d9b3ae | 48 | */ |
3a86ec51 CW |
49 | function _civicrm_api3_dashboard_contact_create_spec(&$fields) { |
50 | $fields['dashboard_id']['api.required'] = TRUE; | |
15d9b3ae N |
51 | } |
52 | ||
510513d8 | 53 | /** |
dc64d047 | 54 | * Delete an existing dashboard-contact. |
510513d8 | 55 | * |
d0997921 | 56 | * @param array $params |
dc64d047 | 57 | * |
645ee340 EM |
58 | * @return array |
59 | * @throws \API_Exception | |
510513d8 TO |
60 | */ |
61 | function civicrm_api3_dashboard_contact_delete($params) { | |
62 | return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params); | |
63 | } |