4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using participant Get API.
11 * Criteria delete by nesting a GET & a DELETE
16 function participant_get_example() {
19 'api.participant.delete' => 1,
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(
55 'contact_type' => 'Individual',
56 'contact_sub_type' => '',
57 'sort_name' => 'Anderson, Anthony',
58 'display_name' => 'Mr. Anthony Anderson II',
60 'event_title' => 'Annual CiviCRM meet',
61 'event_start_date' => '2013-07-29 00:00:00',
62 'event_end_date' => '2013-08-04 00:00:00',
63 'participant_id' => '2',
64 'participant_fee_level' => '',
65 'participant_fee_amount' => '',
66 'participant_fee_currency' => '',
67 'event_type' => 'Conference',
68 'participant_status_id' => '2',
69 'participant_status' => 'Attended',
70 'participant_role' => 'Attendee',
71 'participant_role_id' => '1',
72 'participant_register_date' => '2007-02-19 00:00:00',
73 'participant_source' => 'Wimbeldon',
74 'participant_note' => '',
75 'participant_is_pay_later' => 0,
76 'participant_is_test' => 0,
77 'participant_registered_by_id' => '',
78 'participant_discount_name' => '',
79 'participant_campaign_id' => '',
81 'api.participant.delete' => array(
90 'contact_type' => 'Individual',
91 'contact_sub_type' => '',
92 'sort_name' => 'Anderson, Anthony',
93 'display_name' => 'Mr. Anthony Anderson II',
95 'event_title' => 'Annual CiviCRM meet',
96 'event_start_date' => '2013-07-29 00:00:00',
97 'event_end_date' => '2013-08-04 00:00:00',
98 'participant_id' => '3',
99 'participant_fee_level' => '',
100 'participant_fee_amount' => '',
101 'participant_fee_currency' => '',
102 'event_type' => 'Conference',
103 'participant_status_id' => '2',
104 'participant_status' => 'Attended',
105 'participant_role' => 'Attendee',
106 'participant_role_id' => '1',
107 'participant_register_date' => '2007-02-19 00:00:00',
108 'participant_source' => 'Wimbeldon',
109 'participant_note' => '',
110 'participant_is_pay_later' => 0,
111 'participant_is_test' => 0,
112 'participant_registered_by_id' => '',
113 'participant_discount_name' => '',
114 'participant_campaign_id' => '',
116 'api.participant.delete' => array(
126 return $expectedResult;
130 * This example has been generated from the API test suite.
131 * The test that created it is called
133 * and can be found in
134 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantTest.php
136 * You can see the outcome of the API tests at
137 * https://test.civicrm.org/job/CiviCRM-master-git/
139 * To Learn about the API read
140 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
142 * Browse the api on your own site with the api explorer
143 * http://MYSITE.ORG/path/to/civicrm/api/explorer
145 * Read more about testing here
146 * http://wiki.civicrm.org/confluence/display/CRM/Testing
148 * API Standards documentation:
149 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards