commiting uncommited changes on live site
[weblabels.fsf.org.git] / crm.fsf.org / 20131203 / files / sites / all / modules-new / civicrm / api / v3 / examples / Event / IsFullOption.php
1 <?php
2 /**
3 * Test Generated example demonstrating the Event.getsingle API.
4 *
5 * Demonstrates use of return is_full .
6 *
7 * @return array
8 * API result array
9 */
10 function event_getsingle_example() {
11 $params = array(
12 'id' => 1,
13 'return.is_full' => 1,
14 );
15
16 try{
17 $result = civicrm_api3('Event', 'getsingle', $params);
18 }
19 catch (CiviCRM_API3_Exception $e) {
20 // Handle error here.
21 $errorMessage = $e->getMessage();
22 $errorCode = $e->getErrorCode();
23 $errorData = $e->getExtraParams();
24 return array(
25 'error' => $errorMessage,
26 'error_code' => $errorCode,
27 'error_data' => $errorData,
28 );
29 }
30
31 return $result;
32 }
33
34 /**
35 * Function returns array of result expected from previous function.
36 *
37 * @return array
38 * API result array
39 */
40 function event_getsingle_expectedresult() {
41
42 $expectedResult = array(
43 'id' => '1',
44 'title' => 'Annual CiviCRM meet',
45 'event_title' => 'Annual CiviCRM meet',
46 'event_type_id' => '1',
47 'participant_listing_id' => 0,
48 'is_public' => '1',
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',
53 'is_monetary' => 0,
54 'is_map' => 0,
55 'is_active' => '1',
56 'is_show_location' => '1',
57 'default_role_id' => '1',
58 'is_email_confirm' => 0,
59 'is_pay_later' => 0,
60 'is_partial_payment' => 0,
61 'is_multiple_registrations' => 0,
62 'allow_same_participant_emails' => 0,
63 'is_template' => 0,
64 'created_date' => '2015-02-22 23:13:11',
65 'is_share' => '1',
66 'is_confirm_enabled' => '1',
67 'is_billing_required' => 0,
68 'available_places' => 0,
69 'is_full' => '1',
70 );
71
72 return $expectedResult;
73 }
74
75 /*
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
80 *
81 * You can see the outcome of the API tests at
82 * https://test.civicrm.org/job/CiviCRM-master-git/
83 *
84 * To Learn about the API read
85 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
86 *
87 * Browse the api on your own site with the api explorer
88 * http://MYSITE.ORG/path/to/civicrm/api
89 *
90 * Read more about testing here
91 * http://wiki.civicrm.org/confluence/display/CRM/Testing
92 *
93 * API Standards documentation:
94 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
95 */