Merge pull request #265 from colemanw/del-fix
[civicrm-core.git] / api / v3 / examples / ParticipantGet.php
CommitLineData
6a488035
TO
1<?php
2
3/*
4
5 */
6function participant_get_example(){
7$params = array(
8 'id' => 1,
9 'version' => 3,
10);
11
12 $result = civicrm_api( 'participant','get',$params );
13
14 return $result;
15}
16
17/*
18 * Function returns array of result expected from previous function
19 */
20function participant_get_expectedresult(){
21
22 $expectedResult = array(
23 'is_error' => 0,
24 'version' => 3,
25 'count' => 1,
26 'id' => 1,
27 'values' => array(
28 '1' => array(
29 'contact_id' => '2',
30 'contact_type' => 'Individual',
31 'contact_sub_type' => '',
32 'sort_name' => 'Anderson, Anthony',
33 'display_name' => 'Mr. Anthony Anderson II',
34 'event_id' => '5',
35 'event_title' => 'Annual CiviCRM meet',
36 'event_start_date' => '2008-10-21 00:00:00',
37 'event_end_date' => '2008-10-23 00:00:00',
38 'participant_id' => '1',
39 'participant_fee_level' => '',
40 'participant_fee_amount' => '',
41 'participant_fee_currency' => '',
42 'event_type' => 'Conference',
43 'participant_status_id' => '2',
44 'participant_status' => 'Attended',
45 'participant_role_id' => '1',
46 'participant_register_date' => '2007-02-19 00:00:00',
47 'participant_source' => 'Wimbeldon',
48 'participant_note' => '',
49 'participant_is_pay_later' => 0,
50 'participant_is_test' => 0,
51 'participant_registered_by_id' => '',
52 'participant_discount_name' => '',
53 'participant_campaign_id' => '',
54 'id' => '1',
55 ),
56 ),
57);
58
59 return $expectedResult ;
60}
61
62
63/*
64* This example has been generated from the API test suite. The test that created it is called
65*
66* testGetParamsAsIdOnly and can be found in
67* http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/ParticipantTest.php
68*
69* You can see the outcome of the API tests at
70* http://tests.dev.civicrm.org/trunk/results-api_v3
71*
72* To Learn about the API read
73* http://book.civicrm.org/developer/current/techniques/api/
74*
75* and review the wiki at
76* http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
77*
78* Read more about testing here
79* http://wiki.civicrm.org/confluence/display/CRM/Testing
80*
81* API Standards documentation:
82* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
83*/