3 * Test Generated example of using participant create API
6 function participant_create_example(){
12 'register_date' => '2007-07-21 00:00:00',
13 'source' => 'Online Event Registration: API Testing',
14 'custom_1' => 'custom string',
18 $result = civicrm_api3('participant', 'create', $params);
20 catch (CiviCRM_API3_Exception
$e) {
22 $errorMessage = $e->getMessage();
23 $errorCode = $e->getErrorCode();
24 $errorData = $e->getExtraParams();
25 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
32 * Function returns array of result expected from previous function
34 function participant_create_expectedresult(){
36 $expectedResult = array(
48 'register_date' => '20070721000000',
49 'source' => 'Online Event Registration: API Testing',
54 'registered_by_id' => '',
58 'discount_amount' => '',
65 return $expectedResult;
70 * This example has been generated from the API test suite. The test that created it is called
72 * testCreateWithCustom and can be found in
73 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/ParticipantTest.php
75 * You can see the outcome of the API tests at
76 * https://test.civicrm.org/job/CiviCRM-master-git/
78 * To Learn about the API read
79 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
81 * Browse the api on your own site with the api explorer
82 * http://MYSITE.ORG/path/to/civicrm/api/explorer
84 * Read more about testing here
85 * http://wiki.civicrm.org/confluence/display/CRM/Testing
87 * API Standards documentation:
88 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards