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 Dashboard.
15 * @package CiviCRM_APIv3
19 * Creates or updates an Dashlet.
21 * @param array $params
24 * Array containing 'is_error' to denote success or failure and details of the created activity
26 function civicrm_api3_dashboard_create($params) {
27 civicrm_api3_verify_one_mandatory($params, NULL, [
33 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params, 'Dashboard');
37 * Specify Meta data for create.
39 * Note that this data is retrievable via the getfields function
40 * and is used for pre-filling defaults and ensuring mandatory requirements are met.
42 * @param array $params
43 * array of parameters determined by getfields.
45 function _civicrm_api3_dashboard_create_spec(&$params) {
46 $params['is_active']['api.default'] = 1;
47 unset($params['version']);
51 * Gets a CiviCRM Dashlets according to parameters.
53 * @param array $params
57 function civicrm_api3_dashboard_get($params) {
58 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__
), $params);
62 * Delete a specified Dashlet.
64 * @param array $params
65 * Array holding 'id' of dashlet to be deleted.
67 * @throws API_Exception
68 * @throws CiviCRM_API3_Exception
70 function civicrm_api3_dashboard_delete($params) {
71 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__
), $params);