3 * Test Generated example of using participant Get API
4 * Criteria delete by nesting a GET & a DELETE *
6 function participant_get_example(){
9 'api.participant.delete' => 1,
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(
38 'contact_type' => 'Individual',
39 'contact_sub_type' => '',
40 'sort_name' => 'Anderson, Anthony',
41 'display_name' => 'Mr. Anthony Anderson II',
43 'event_title' => 'Annual CiviCRM meet',
44 'event_start_date' => '2013-07-29 00:00:00',
45 'event_end_date' => '2013-08-04 00:00:00',
46 'participant_id' => '2',
47 'participant_fee_level' => '',
48 'participant_fee_amount' => '',
49 'participant_fee_currency' => '',
50 'event_type' => 'Conference',
51 'participant_status_id' => '2',
52 'participant_status' => 'Attended',
53 'participant_role_id' => '1',
54 'participant_register_date' => '2007-02-19 00:00:00',
55 'participant_source' => 'Wimbeldon',
56 'participant_note' => '',
57 'participant_is_pay_later' => 0,
58 'participant_is_test' => 0,
59 'participant_registered_by_id' => '',
60 'participant_discount_name' => '',
61 'participant_campaign_id' => '',
63 'api.participant.delete' => array(
72 'contact_type' => 'Individual',
73 'contact_sub_type' => '',
74 'sort_name' => 'Anderson, Anthony',
75 'display_name' => 'Mr. Anthony Anderson II',
77 'event_title' => 'Annual CiviCRM meet',
78 'event_start_date' => '2013-07-29 00:00:00',
79 'event_end_date' => '2013-08-04 00:00:00',
80 'participant_id' => '3',
81 'participant_fee_level' => '',
82 'participant_fee_amount' => '',
83 'participant_fee_currency' => '',
84 'event_type' => 'Conference',
85 'participant_status_id' => '2',
86 'participant_status' => 'Attended',
87 'participant_role_id' => '1',
88 'participant_register_date' => '2007-02-19 00:00:00',
89 'participant_source' => 'Wimbeldon',
90 'participant_note' => '',
91 'participant_is_pay_later' => 0,
92 'participant_is_test' => 0,
93 'participant_registered_by_id' => '',
94 'participant_discount_name' => '',
95 'participant_campaign_id' => '',
97 'api.participant.delete' => array(
107 return $expectedResult;
112 * This example has been generated from the API test suite. The test that created it is called
114 * testNestedDelete and can be found in
115 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ParticipantTest.php
117 * You can see the outcome of the API tests at
118 * http://tests.dev.civicrm.org/trunk/results-api_v3
120 * To Learn about the API read
121 * http://book.civicrm.org/developer/current/techniques/api/
123 * and review the wiki at
124 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
126 * Read more about testing here
127 * http://wiki.civicrm.org/confluence/display/CRM/Testing
129 * API Standards documentation:
130 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards