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 report instances.
15 * @package CiviCRM_APIv3
19 * Retrieve a report instance.
21 * @param array $params
27 function civicrm_api3_report_instance_get($params) {
28 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__
), $params);
32 * Add or update a report instance.
34 * @param array $params
39 function civicrm_api3_report_instance_create($params) {
40 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params, 'ReportInstance');
44 * Adjust Metadata for Create action.
46 * The metadata is used for setting defaults, documentation & validation.
48 * @param array $params
49 * Array of parameters determined by getfields.
51 function _civicrm_api3_report_instance_create_spec(&$params) {
52 $params['report_id']['api.required'] = 1;
53 $params['title']['api.required'] = 1;
54 $params['domain_id']['api.default'] = CRM_Core_Config
::domainID();
55 $params['view_mode']['api.default'] = 'view';
56 $params['view_mode']['title'] = ts('View Mode for Navigation URL');
57 $params['view_mode']['type'] = CRM_Utils_Type
::T_STRING
;
58 $params['view_mode']['options'] = [
60 'criteria' => ts('Show Criteria'),
65 * Deletes an existing ReportInstance.
67 * @param array $params
72 function civicrm_api3_report_instance_delete($params) {
73 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__
), $params);