Merge pull request #3679 from yashodha/CRM-14951
[civicrm-core.git] / api / v3 / ReportInstance.php
CommitLineData
0b25329b
DS
1<?php
2
3/**
4 * Retrieve a report instance
5 *
b64c5392 6 * @param array $params input parameters
0b25329b 7 *
b64c5392 8 * @return array details of found instances
0b25329b
DS
9 * @access public
10 */
11function civicrm_api3_report_instance_get($params) {
12 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
13}
14
15/**
77b97be7
EM
16 * Add or update a report instance.
17 *
18 * @param $params
0b25329b 19 *
b64c5392 20 * @return array of newly created report instance property values.
0b25329b
DS
21 * @access public
22 */
23function civicrm_api3_report_instance_create($params) {
24 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
25}
26
27/**
28 * Adjust Metadata for Create action
29 *
30 * The metadata is used for setting defaults, documentation & validation
31 * @param array $params array or parameters determined by getfields
32 */
33function _civicrm_api3_report_instance_create_spec(&$params) {
34 $params['report_id']['api.required'] = 1;
35 $params['title']['api.required'] = 1;
36}
37
38/**
39 * Deletes an existing ReportInstance
40 *
41 * @param array $params
42 *
0b25329b 43 * @return array Api result
0b25329b
DS
44 * @access public
45 */
46function civicrm_api3_report_instance_delete($params) {
47 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
48}