4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using participant get API.
11 * use nested get to get an event
16 function participant_get_example() {
23 $result = civicrm_api3('participant', 'get', $params);
25 catch (CiviCRM_API3_Exception
$e) {
27 $errorMessage = $e->getMessage();
28 $errorCode = $e->getErrorCode();
29 $errorData = $e->getExtraParams();
31 'error' => $errorMessage,
32 'error_code' => $errorCode,
33 'error_data' => $errorData,
41 * Function returns array of result expected from previous function.
46 function participant_get_expectedresult() {
48 $expectedResult = array(
56 'contact_type' => 'Individual',
57 'contact_sub_type' => '',
58 'sort_name' => 'Anderson, Anthony',
59 'display_name' => 'Mr. Anthony Anderson II',
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' => '',
82 'api.event.get' => array(
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,
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',
110 'is_show_location' => 0,
111 'default_role_id' => '1',
112 'is_email_confirm' => 0,
114 'is_partial_payment' => 0,
115 'is_multiple_registrations' => 0,
116 'allow_same_participant_emails' => 0,
118 'created_date' => '2013-07-28 08:49:19',
120 'is_confirm_enabled' => '1',
121 'is_billing_required' => 0,
129 return $expectedResult;
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
139 * You can see the outcome of the API tests at
140 * https://test.civicrm.org/job/CiviCRM-master-git/
142 * To Learn about the API read
143 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
145 * Browse the api on your own site with the api explorer
146 * http://MYSITE.ORG/path/to/civicrm/api/explorer
148 * Read more about testing here
149 * http://wiki.civicrm.org/confluence/display/CRM/Testing
151 * API Standards documentation:
152 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards