3 * Test Generated example demonstrating the ReportTemplate.getrows API.
5 * Retrieve rows from a report template (optionally providing the instance_id).
10 function report_template_getrows_example() {
12 'report_id' => 'contact/summary',
22 $result = civicrm_api3('ReportTemplate', 'getrows', $params);
24 catch (CiviCRM_API3_Exception
$e) {
26 $errorMessage = $e->getMessage();
27 $errorCode = $e->getErrorCode();
28 $errorData = $e->getExtraParams();
31 'error_message' => $errorMessage,
32 'error_code' => $errorCode,
33 'error_data' => $errorData,
41 * Function returns array of result expected from previous function.
46 function report_template_getrows_expectedresult() {
48 $expectedResult = array(
54 'civicrm_contact_sort_name' => 'Second Domain',
55 'civicrm_contact_id' => '2',
56 'civicrm_contact_sort_name_link' => '/index.php?q=civicrm/report/contact/detail&reset=1&force=1&id_op=eq&id_value=2',
57 'civicrm_contact_sort_name_hover' => 'View Contact Detail Report for this contact',
60 'civicrm_contact_sort_name' => 'Unit Test Organization',
61 'civicrm_contact_id' => '1',
62 'civicrm_contact_sort_name_link' => '/index.php?q=civicrm/report/contact/detail&reset=1&force=1&id_op=eq&id_value=1',
63 'civicrm_contact_sort_name_hover' => 'View Contact Detail Report for this contact',
67 'title' => 'ERROR: Title is not Set',
69 'civicrm_contact_sort_name' => 'Contact Name',
74 return $expectedResult;
78 * This example has been generated from the API test suite.
79 * The test that created it is called "testReportTemplateGetRowsContactSummary"
80 * and can be found at:
81 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ReportTemplateTest.php
83 * You can see the outcome of the API tests at
84 * https://test.civicrm.org/job/CiviCRM-master-git/
86 * To Learn about the API read
87 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
89 * Browse the api on your own site with the api explorer
90 * http://MYSITE.ORG/path/to/civicrm/api
92 * Read more about testing here
93 * http://wiki.civicrm.org/confluence/display/CRM/Testing
95 * API Standards documentation:
96 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards