3 * Test Generated example of using event get API.
5 * demonstrates use of is.Current option
10 function event_get_example() {
16 $result = civicrm_api3('event', 'get', $params);
18 catch (CiviCRM_API3_Exception
$e) {
20 $errorMessage = $e->getMessage();
21 $errorCode = $e->getErrorCode();
22 $errorData = $e->getExtraParams();
24 'error' => $errorMessage,
25 'error_code' => $errorCode,
26 'error_data' => $errorData,
34 * Function returns array of result expected from previous function.
39 function event_get_expectedresult() {
41 $expectedResult = array(
49 'title' => 'Annual CiviCRM meet 2',
50 'event_title' => 'Annual CiviCRM meet 2',
51 'summary' => 'If you have any CiviCRM realted issues or want to track where CiviCRM is heading, Sign up now',
52 'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
53 'event_description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
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 'end_date' => '2013-08-04 00:00:00',
60 'event_end_date' => '2013-08-04 00:00:00',
61 'is_online_registration' => '1',
62 'registration_start_date' => '2010-06-01 00:00:00',
63 'registration_end_date' => '2010-10-15 00:00:00',
64 'max_participants' => '100',
65 'event_full_text' => 'Sorry! We are already full',
69 'is_show_location' => 0,
70 'default_role_id' => '1',
71 'is_email_confirm' => 0,
73 'is_partial_payment' => 0,
74 'is_multiple_registrations' => 0,
75 'allow_same_participant_emails' => 0,
77 'created_date' => '2013-07-28 08:49:19',
79 'is_confirm_enabled' => '1',
80 'is_billing_required' => 0,
85 return $expectedResult;
89 * This example has been generated from the API test suite.
90 * The test that created it is called
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