3 * Test Generated example demonstrating the Event.get API.
5 * Demonstrates get with Contact Reference Custom Field.
10 function event_get_example() {
12 'return.custom_2' => 1,
17 $result = civicrm_api3('Event', 'get', $params);
19 catch (CiviCRM_API3_Exception
$e) {
21 $errorMessage = $e->getMessage();
22 $errorCode = $e->getErrorCode();
23 $errorData = $e->getExtraParams();
26 'error_message' => $errorMessage,
27 'error_code' => $errorCode,
28 'error_data' => $errorData,
36 * Function returns array of result expected from previous function.
41 function event_get_expectedresult() {
43 $expectedResult = array(
51 'title' => 'My test event.',
52 'event_title' => 'My test event.',
53 'event_description' => '',
54 'event_type_id' => '1',
55 'participant_listing_id' => 0,
57 'start_date' => '2013-07-29 00:00:00',
58 'event_start_date' => '2013-07-29 00:00:00',
59 'event_end_date' => '',
60 'is_online_registration' => 0,
64 'is_show_location' => '1',
65 'default_role_id' => '1',
66 'is_email_confirm' => 0,
68 'is_partial_payment' => 0,
69 'is_multiple_registrations' => 0,
70 'max_additional_participants' => 0,
71 'allow_same_participant_emails' => 0,
72 'allow_selfcancelxfer' => 0,
73 'selfcancelxfer_time' => 0,
75 'created_date' => '2013-07-28 08:49:19',
77 'is_confirm_enabled' => '1',
78 'is_billing_required' => 0,
79 'custom_1' => 'defaultValue',
81 'custom_2' => 'Contact, Test',
86 return $expectedResult;
90 * This example has been generated from the API test suite.
91 * The test that created it is called "testEventGetCustomContactRefFieldCRM16036"
92 * and can be found at:
93 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EventTest.php
95 * You can see the outcome of the API tests at
96 * https://test.civicrm.org/job/CiviCRM-master-git/
98 * To Learn about the API read
99 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
101 * Browse the api on your own site with the api explorer
102 * http://MYSITE.ORG/path/to/civicrm/api
104 * Read more about testing here
105 * http://wiki.civicrm.org/confluence/display/CRM/Testing
107 * API Standards documentation:
108 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards