Merge pull request #1035 from GiantRobot/CRM-12720
[civicrm-core.git] / api / v3 / examples / Event / IsCurrentOption.php
1 <?php
2
3 /*
4 demonstrates use of is.Current option
5 */
6 function event_get_example(){
7 $params = array(
8 'isCurrent' => 1,
9 'version' => 3,
10 'debug' => 0,
11 );
12
13 $result = civicrm_api( 'event','get',$params );
14
15 return $result;
16 }
17
18 /*
19 * Function returns array of result expected from previous function
20 */
21 function event_get_expectedresult(){
22
23 $expectedResult = array(
24 'is_error' => 0,
25 'version' => 3,
26 'count' => 1,
27 'id' => 3,
28 'values' => array(
29 '3' => array(
30 'id' => '3',
31 'title' => 'Annual CiviCRM meet 2',
32 'event_title' => 'Annual CiviCRM meet 2',
33 'summary' => 'If you have any CiviCRM realted issues or want to track where CiviCRM is heading, Sign up now',
34 'description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
35 'event_description' => 'This event is intended to give brief idea about progess of CiviCRM and giving solutions to common user issues',
36 'event_type_id' => '1',
37 'participant_listing_id' => 0,
38 'is_public' => '1',
39 'start_date' => '2013-06-23 00:00:00',
40 'event_start_date' => '2013-06-23 00:00:00',
41 'end_date' => '2013-06-29 00:00:00',
42 'event_end_date' => '2013-06-29 00:00:00',
43 'is_online_registration' => '1',
44 'registration_start_date' => '2010-06-01 00:00:00',
45 'registration_end_date' => '2010-10-15 00:00:00',
46 'max_participants' => '100',
47 'event_full_text' => 'Sorry! We are already full',
48 'is_monetary' => 0,
49 'is_map' => 0,
50 'is_active' => '1',
51 'is_show_location' => 0,
52 'default_role_id' => '1',
53 'is_email_confirm' => 0,
54 'is_pay_later' => 0,
55 'is_partial_payment' => 0,
56 'is_multiple_registrations' => 0,
57 'allow_same_participant_emails' => 0,
58 'is_template' => 0,
59 'created_date' => '20120130621222105',
60 'is_share' => '1',
61 ),
62 ),
63 );
64
65 return $expectedResult ;
66 }
67
68
69 /*
70 * This example has been generated from the API test suite. The test that created it is called
71 *
72 * testGetIsCurrent and can be found in
73 * http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/EventTest.php
74 *
75 * You can see the outcome of the API tests at
76 * http://tests.dev.civicrm.org/trunk/results-api_v3
77 *
78 * To Learn about the API read
79 * http://book.civicrm.org/developer/current/techniques/api/
80 *
81 * and review the wiki at
82 * http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
83 *
84 * Read more about testing here
85 * http://wiki.civicrm.org/confluence/display/CRM/Testing
86 *
87 * API Standards documentation:
88 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
89 */