Merge pull request #1238 from sfe-ev/CRM-12995_amend
[civicrm-core.git] / api / v3 / examples / UFFieldGet.php
CommitLineData
6a488035
TO
1<?php
2
3/*
4
5 */
6function uf_field_get_example(){
ee600d6f 7$params = array(
6a488035 8 'version' => 3,
ee600d6f 9 'debug' => 0,
6a488035
TO
10);
11
12 $result = civicrm_api( 'uf_field','get',$params );
13
14 return $result;
15}
16
17/*
18 * Function returns array of result expected from previous function
19 */
20function uf_field_get_expectedresult(){
21
ee600d6f 22 $expectedResult = array(
6a488035
TO
23 'is_error' => 0,
24 'version' => 3,
25 'count' => 1,
26 'id' => 1,
ee600d6f 27 'values' => array(
28 '1' => array(
6a488035
TO
29 'id' => '1',
30 'uf_group_id' => '11',
31 'field_name' => 'phone',
32 'is_active' => '1',
33 'is_view' => 0,
34 'is_required' => 0,
35 'weight' => '1',
36 'visibility' => 'Public Pages and Listings',
37 'in_selector' => 0,
38 'is_searchable' => '1',
39 'location_type_id' => '1',
40 'phone_type_id' => '1',
41 'label' => 'Test Phone',
42 'field_type' => 'Contact',
43 'is_multi_summary' => 0,
44 ),
45 ),
46);
47
48 return $expectedResult ;
49}
50
51
52/*
53* This example has been generated from the API test suite. The test that created it is called
54*
55* testGetUFFieldSuccess and can be found in
56* http://svn.civicrm.org/civicrm/trunk/tests/phpunit/CiviTest/api/v3/UFFieldTest.php
57*
58* You can see the outcome of the API tests at
59* http://tests.dev.civicrm.org/trunk/results-api_v3
60*
61* To Learn about the API read
62* http://book.civicrm.org/developer/current/techniques/api/
63*
64* and review the wiki at
65* http://wiki.civicrm.org/confluence/display/CRMDOC/CiviCRM+Public+APIs
66*
67* Read more about testing here
68* http://wiki.civicrm.org/confluence/display/CRM/Testing
69*
70* API Standards documentation:
71* http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards
72*/