infra updated incorrectly set public functions to private on payment classes
[civicrm-core.git] / api / v3 / examples / Participant / NestedEventGet.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 participant get API.
10 *
11 * use nested get to get an event
12 *
13 * @return array
14 * API result array
15 */
16 function participant_get_example() {
17 $params = array(
18 'id' => 1,
19 'api.event.get' => 1,
20 );
21
22 try{
23 $result = civicrm_api3('participant', 'get', $params);
24 }
25 catch (CiviCRM_API3_Exception $e) {
26 // Handle error here.
27 $errorMessage = $e->getMessage();
28 $errorCode = $e->getErrorCode();
29 $errorData = $e->getExtraParams();
30 return array(
31 'error' => $errorMessage,
32 'error_code' => $errorCode,
33 'error_data' => $errorData,
34 );
35 }
36
37 return $result;
38 }
39
40 /**
41 * Function returns array of result expected from previous function.
42 *
43 * @return array
44 * API result array
45 */
46 function participant_get_expectedresult() {
47
48 $expectedResult = array(
49 'is_error' => 0,
50 'version' => 3,
51 'count' => 1,
52 'id' => 1,
53 'values' => array(
54 '1' => array(
55 'contact_id' => '2',
56 'contact_type' => 'Individual',
57 'contact_sub_type' => '',
58 'sort_name' => 'Anderson, Anthony',
59 'display_name' => 'Mr. Anthony Anderson II',
60 'event_id' => '6',
61 'event_title' => 'Annual CiviCRM meet',
62 'event_start_date' => '2013-07-29 00:00:00',
63 'event_end_date' => '2013-08-04 00:00:00',
64 'participant_id' => '1',
65 'participant_fee_level' => '',
66 'participant_fee_amount' => '',
67 'participant_fee_currency' => '',
68 'event_type' => 'Conference',
69 'participant_status_id' => '2',
70 'participant_status' => 'Attended',
71 'participant_role' => 'Attendee',
72 'participant_role_id' => '1',
73 'participant_register_date' => '2007-02-19 00:00:00',
74 'participant_source' => 'Wimbeldon',
75 'participant_note' => '',
76 'participant_is_pay_later' => 0,
77 'participant_is_test' => 0,
78 'participant_registered_by_id' => '',
79 'participant_discount_name' => '',
80 'participant_campaign_id' => '',
81 'id' => '1',
82 'api.event.get' => array(
83 'is_error' => 0,
84 'version' => 3,
85 'count' => 1,
86 'id' => 6,
87 'values' => array(
88 '0' => array(
89 'id' => '6',
90 'title' => 'Annual CiviCRM meet',
91 'event_title' => 'Annual CiviCRM meet',
92 'summary' => 'If you have any CiviCRM related issues or want to track where CiviCRM is heading, Sign up now',
93 'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
94 'event_description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
95 'event_type_id' => '1',
96 'participant_listing_id' => 0,
97 'is_public' => '1',
98 'start_date' => '2013-07-29 00:00:00',
99 'event_start_date' => '2013-07-29 00:00:00',
100 'end_date' => '2013-08-04 00:00:00',
101 'event_end_date' => '2013-08-04 00:00:00',
102 'is_online_registration' => '1',
103 'registration_start_date' => '2008-06-01 00:00:00',
104 'registration_end_date' => '2008-10-15 00:00:00',
105 'max_participants' => '100',
106 'event_full_text' => 'Sorry! We are already full',
107 'is_monetary' => 0,
108 'is_map' => 0,
109 'is_active' => '1',
110 'is_show_location' => 0,
111 'default_role_id' => '1',
112 'is_email_confirm' => 0,
113 'is_pay_later' => 0,
114 'is_partial_payment' => 0,
115 'is_multiple_registrations' => 0,
116 'allow_same_participant_emails' => 0,
117 'is_template' => 0,
118 'created_date' => '2013-07-28 08:49:19',
119 'is_share' => '1',
120 'is_confirm_enabled' => '1',
121 'is_billing_required' => 0,
122 ),
123 ),
124 ),
125 ),
126 ),
127 );
128
129 return $expectedResult;
130 }
131
132 /**
133 * This example has been generated from the API test suite.
134 * The test that created it is called
135 * testGetNestedEventGet
136 * and can be found in
137 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantTest.php
138 *
139 * You can see the outcome of the API tests at
140 * https://test.civicrm.org/job/CiviCRM-master-git/
141 *
142 * To Learn about the API read
143 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
144 *
145 * Browse the api on your own site with the api explorer
146 * http://MYSITE.ORG/path/to/civicrm/api/explorer
147 *
148 * Read more about testing here
149 * http://wiki.civicrm.org/confluence/display/CRM/Testing
150 *
151 * API Standards documentation:
152 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
153 */