3 * Test Generated example of using event get API
4 * demonstrates use of is.Current option *
6 function event_get_example(){
12 $result = civicrm_api3('event', 'get', $params);
14 catch (CiviCRM_API3_Exception
$e) {
16 $errorMessage = $e->getMessage();
17 $errorCode = $e->getErrorCode();
18 $errorData = $e->getExtraParams();
19 return array('error' => $errorMessage, 'error_code' => $errorCode, 'error_data' => $errorData);
26 * Function returns array of result expected from previous function
28 function event_get_expectedresult(){
30 $expectedResult = array(
38 'title' => 'Annual CiviCRM meet 2',
39 'event_title' => 'Annual CiviCRM meet 2',
40 'summary' => 'If you have any CiviCRM realted issues or want to track where CiviCRM is heading, Sign up now',
41 'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
42 'event_description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
43 'event_type_id' => '1',
44 'participant_listing_id' => 0,
46 'start_date' => '2013-07-29 00:00:00',
47 'event_start_date' => '2013-07-29 00:00:00',
48 'end_date' => '2013-08-04 00:00:00',
49 'event_end_date' => '2013-08-04 00:00:00',
50 'is_online_registration' => '1',
51 'registration_start_date' => '2010-06-01 00:00:00',
52 'registration_end_date' => '2010-10-15 00:00:00',
53 'max_participants' => '100',
54 'event_full_text' => 'Sorry! We are already full',
58 'is_show_location' => 0,
59 'default_role_id' => '1',
60 'is_email_confirm' => 0,
62 'is_partial_payment' => 0,
63 'is_multiple_registrations' => 0,
64 'allow_same_participant_emails' => 0,
66 'created_date' => '2013-07-28 08:49:19',
72 return $expectedResult;
77 * This example has been generated from the API test suite. The test that created it is called
79 * testGetIsCurrent and can be found in
80 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/EventTest.php
82 * You can see the outcome of the API tests at
83 * https://test.civicrm.org/job/CiviCRM-master-git/
85 * To Learn about the API read
86 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
88 * Browse the api on your own site with the api explorer
89 * http://MYSITE.ORG/path/to/civicrm/api/explorer
91 * Read more about testing here
92 * http://wiki.civicrm.org/confluence/display/CRM/Testing
94 * API Standards documentation:
95 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards