3 * Test Generated example of using participant get API
4 * use nested get to get an event *
6 function participant_get_example(){
13 $result = civicrm_api3('participant', 'get', $params);
15 catch (CiviCRM_API3_Exception
$e) {
17 $errorMessage = $e->getMessage();
18 $errorCode = $e->getErrorCode();
19 $errorData = $e->getExtraParams();
20 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
27 * Function returns array of result expected from previous function
29 function participant_get_expectedresult(){
31 $expectedResult = array(
39 'contact_type' => 'Individual',
40 'contact_sub_type' => '',
41 'sort_name' => 'Anderson, Anthony',
42 'display_name' => 'Mr. Anthony Anderson II',
44 'event_title' => 'Annual CiviCRM meet',
45 'event_start_date' => '2013-07-29 00:00:00',
46 'event_end_date' => '2013-08-04 00:00:00',
47 'participant_id' => '1',
48 'participant_fee_level' => '',
49 'participant_fee_amount' => '',
50 'participant_fee_currency' => '',
51 'event_type' => 'Conference',
52 'participant_status_id' => '2',
53 'participant_status' => 'Attended',
54 'participant_role_id' => '1',
55 'participant_register_date' => '2007-02-19 00:00:00',
56 'participant_source' => 'Wimbeldon',
57 'participant_note' => '',
58 'participant_is_pay_later' => 0,
59 'participant_is_test' => 0,
60 'participant_registered_by_id' => '',
61 'participant_discount_name' => '',
62 'participant_campaign_id' => '',
64 'api.event.get' => array(
72 'title' => 'Annual CiviCRM meet',
73 'event_title' => 'Annual CiviCRM meet',
74 'summary' => 'If you have any CiviCRM related issues or want to track where CiviCRM is heading, Sign up now',
75 'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
76 'event_description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
77 'event_type_id' => '1',
78 'participant_listing_id' => 0,
80 'start_date' => '2013-07-29 00:00:00',
81 'event_start_date' => '2013-07-29 00:00:00',
82 'end_date' => '2013-08-04 00:00:00',
83 'event_end_date' => '2013-08-04 00:00:00',
84 'is_online_registration' => '1',
85 'registration_start_date' => '2008-06-01 00:00:00',
86 'registration_end_date' => '2008-10-15 00:00:00',
87 'max_participants' => '100',
88 'event_full_text' => 'Sorry! We are already full',
92 'is_show_location' => 0,
93 'default_role_id' => '1',
94 'is_email_confirm' => 0,
96 'is_partial_payment' => 0,
97 'is_multiple_registrations' => 0,
98 'allow_same_participant_emails' => 0,
100 'created_date' => '2013-07-28 08:49:19',
109 return $expectedResult;
114 * This example has been generated from the API test suite. The test that created it is called
116 * testGetNestedEventGet and can be found in
117 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantTest.php
119 * You can see the outcome of the API tests at
120 * https://test.civicrm.org/job/CiviCRM-master-git/
122 * To Learn about the API read
123 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
125 * Browse the api on your own site with the api explorer
126 * http://MYSITE.ORG/path/to/civicrm/api/explorer
128 * Read more about testing here
129 * http://wiki.civicrm.org/confluence/display/CRM/Testing
131 * API Standards documentation:
132 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards