Merge pull request #1083 from deepak-srivastava/reportsapi
[civicrm-core.git] / api / v3 / ReportInstance.php
1 <?php
2
3 /**
4 * Retrieve a report instance
5 *
6 * FIXME This is a bare-minimum placeholder
7 *
8 * @param array $ params input parameters
9 *
10 * {@example OptionValueGet.php 0}
11 * @example OptionValueGet.php
12 *
13 * @return array details of found Option Values
14 * {@getfields OptionValue_get}
15 * @access public
16 */
17 function civicrm_api3_report_instance_get($params) {
18 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
19 }
20
21 /**
22 * Add a OptionValue. OptionValues are used to classify CRM entities (including Contacts, Groups and Actions).
23 *
24 * Allowed @params array keys are:
25 *
26 * {@example OptionValueCreate.php}
27 *
28 * @return array of newly created option_value property values.
29 * {@getfields OptionValue_create}
30 * @access public
31 */
32 function civicrm_api3_report_instance_create($params) {
33 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
34 }
35
36 /**
37 * Adjust Metadata for Create action
38 *
39 * The metadata is used for setting defaults, documentation & validation
40 * @param array $params array or parameters determined by getfields
41 */
42 function _civicrm_api3_report_instance_create_spec(&$params) {
43 $params['report_id']['api.required'] = 1;
44 $params['title']['api.required'] = 1;
45 }
46
47 /**
48 * Deletes an existing ReportInstance
49 *
50 * @param array $params
51 *
52 * {@example ReportInstanceDelete.php 0}
53 *
54 * @return array Api result
55 * {@getfields ReportInstance_create}
56 * @access public
57 */
58 function civicrm_api3_report_instance_delete($params) {
59 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
60 }