infra updated incorrectly set public functions to private on payment classes
[civicrm-core.git] / api / v3 / examples / Activity / Get.php
1 <?php
2 /**
3 * @file
4 * Test Generated API Example.
5 * See bottom of this file for more detail.
6 */
7
8 /**
9 * Test Generated example of using activity get API.
10 *
11 *
12 * @return array
13 * API result array
14 */
15 function activity_get_example() {
16 $params = array(
17 'contact_id' => 1,
18 'activity_type_id' => '51',
19 'sequential' => 1,
20 'return.custom_1' => 1,
21 );
22
23 try{
24 $result = civicrm_api3('activity', 'get', $params);
25 }
26 catch (CiviCRM_API3_Exception $e) {
27 // Handle error here.
28 $errorMessage = $e->getMessage();
29 $errorCode = $e->getErrorCode();
30 $errorData = $e->getExtraParams();
31 return array(
32 'error' => $errorMessage,
33 'error_code' => $errorCode,
34 'error_data' => $errorData,
35 );
36 }
37
38 return $result;
39 }
40
41 /**
42 * Function returns array of result expected from previous function.
43 *
44 * @return array
45 * API result array
46 */
47 function activity_get_expectedresult() {
48
49 $expectedResult = array(
50 'is_error' => 0,
51 'version' => 3,
52 'count' => 1,
53 'id' => 1,
54 'values' => array(
55 '0' => array(
56 'source_contact_id' => '1',
57 'id' => '1',
58 'activity_type_id' => '51',
59 'subject' => 'test activity type id',
60 'location' => 'Pensulvania',
61 'activity_date_time' => '2011-06-02 14:36:13',
62 'details' => 'a test activity',
63 'status_id' => '2',
64 'activity_name' => 'Test activity type',
65 'status' => 'Completed',
66 'custom_1' => 'custom string',
67 'custom_1_1' => 'custom string',
68 ),
69 ),
70 );
71
72 return $expectedResult;
73 }
74
75 /**
76 * This example has been generated from the API test suite.
77 * The test that created it is called
78 * testActivityGetContact_idCustom
79 * and can be found in
80 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ActivityTest.php
81 *
82 * You can see the outcome of the API tests at
83 * https://test.civicrm.org/job/CiviCRM-master-git/
84 *
85 * To Learn about the API read
86 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
87 *
88 * Browse the api on your own site with the api explorer
89 * http://MYSITE.ORG/path/to/civicrm/api/explorer
90 *
91 * Read more about testing here
92 * http://wiki.civicrm.org/confluence/display/CRM/Testing
93 *
94 * API Standards documentation:
95 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
96 */