3 * Test Generated example demonstrating the Participant.create API.
8 function participant_create_example() {
14 'register_date' => '2007-07-21 00:00:00',
15 'source' => 'Online Event Registration: API Testing',
16 'custom_1' => 'custom string',
20 $result = civicrm_api3('Participant', 'create', $params);
22 catch (CiviCRM_API3_Exception
$e) {
24 $errorMessage = $e->getMessage();
25 $errorCode = $e->getErrorCode();
26 $errorData = $e->getExtraParams();
29 'error_message' => $errorMessage,
30 'error_code' => $errorCode,
31 'error_data' => $errorData,
39 * Function returns array of result expected from previous function.
44 function participant_create_expectedresult() {
58 'register_date' => '20070721000000',
59 'source' => 'Online Event Registration: API Testing',
64 'registered_by_id' => '',
68 'discount_amount' => '',
71 'transferred_to_contact_id' => '',
76 return $expectedResult;
80 * This example has been generated from the API test suite.
81 * The test that created it is called "testCreateWithCustom"
82 * and can be found at:
83 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantTest.php
85 * You can see the outcome of the API tests at
86 * https://test.civicrm.org/job/CiviCRM-master-git/
88 * To Learn about the API read
89 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
91 * Browse the api on your own site with the api explorer
92 * http://MYSITE.ORG/path/to/civicrm/api
94 * Read more about testing here
95 * http://wiki.civicrm.org/confluence/display/CRM/Testing
97 * API Standards documentation:
98 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards