Short array syntax - auto-convert api dir
[civicrm-core.git] / api / v3 / examples / SurveyRespondant / Get.php
1 <?php
2 /**
3 * Test Generated example demonstrating the SurveyRespondant.get API.
4 *
5 * @deprecated
6 * The SurveyRespondant api is not currently supported.
7 *
8 * @return array
9 * API result array
10 */
11 function survey_respondant_get_example() {
12 $params = [
13 'sequential' => '1',
14 'survey_id' => 1,
15 ];
16
17 try{
18 $result = civicrm_api3('SurveyRespondant', 'get', $params);
19 }
20 catch (CiviCRM_API3_Exception $e) {
21 // Handle error here.
22 $errorMessage = $e->getMessage();
23 $errorCode = $e->getErrorCode();
24 $errorData = $e->getExtraParams();
25 return [
26 'is_error' => 1,
27 'error_message' => $errorMessage,
28 'error_code' => $errorCode,
29 'error_data' => $errorData,
30 ];
31 }
32
33 return $result;
34 }
35
36 /**
37 * Function returns array of result expected from previous function.
38 *
39 * @return array
40 * API result array
41 */
42 function survey_respondant_get_expectedresult() {
43
44 $expectedResult = [
45 'is_error' => 0,
46 'version' => 3,
47 'count' => 0,
48 'values' => [],
49 'deprecated' => 'The SurveyRespondant api is not currently supported.',
50 ];
51
52 return $expectedResult;
53 }
54
55 /*
56 * This example has been generated from the API test suite.
57 * The test that created it is called "testGetSurveyRespondants"
58 * and can be found at:
59 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/SurveyRespondantTest.php
60 *
61 * You can see the outcome of the API tests at
62 * https://test.civicrm.org/job/CiviCRM-master-git/
63 *
64 * To Learn about the API read
65 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
66 *
67 * Browse the api on your own site with the api explorer
68 * http://MYSITE.ORG/path/to/civicrm/api
69 *
70 * Read more about testing here
71 * http://wiki.civicrm.org/confluence/display/CRM/Testing
72 *
73 * API Standards documentation:
74 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
75 */