3 * Test Generated example demonstrating the Event.getsingle API.
5 * Demonstrates use of return is_full .
10 function event_getsingle_example() {
13 'return.is_full' => 1,
17 $result = civicrm_api3('Event', 'getsingle', $params);
19 catch (CiviCRM_API3_Exception
$e) {
21 $errorMessage = $e->getMessage();
22 $errorCode = $e->getErrorCode();
23 $errorData = $e->getExtraParams();
25 'error' => $errorMessage,
26 'error_code' => $errorCode,
27 'error_data' => $errorData,
35 * Function returns array of result expected from previous function.
40 function event_getsingle_expectedresult() {
42 $expectedResult = array(
44 'title' => 'Annual CiviCRM meet',
45 'event_title' => 'Annual CiviCRM meet',
46 'event_type_id' => '1',
47 'participant_listing_id' => 0,
49 'start_date' => '2008-10-21 00:00:00',
50 'event_start_date' => '2008-10-21 00:00:00',
51 'is_online_registration' => 0,
52 'max_participants' => '1',
56 'is_show_location' => '1',
57 'default_role_id' => '1',
58 'is_email_confirm' => 0,
60 'is_partial_payment' => 0,
61 'is_multiple_registrations' => 0,
62 'allow_same_participant_emails' => 0,
64 'created_date' => '2015-02-22 23:13:11',
66 'is_confirm_enabled' => '1',
67 'is_billing_required' => 0,
68 'available_places' => 0,
72 return $expectedResult;
76 * This example has been generated from the API test suite.
77 * The test that created it is called "testGetSingleReturnIsFull"
78 * and can be found at:
79 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EventTest.php
81 * You can see the outcome of the API tests at
82 * https://test.civicrm.org/job/CiviCRM-master-git/
84 * To Learn about the API read
85 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
87 * Browse the api on your own site with the api explorer
88 * http://MYSITE.ORG/path/to/civicrm/api
90 * Read more about testing here
91 * http://wiki.civicrm.org/confluence/display/CRM/Testing
93 * API Standards documentation:
94 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards