3 * Test Generated example demonstrating the UFField.get API.
8 function uf_field_get_example() {
12 $result = civicrm_api3('UFField', 'get', $params);
14 catch (CiviCRM_API3_Exception
$e) {
16 $errorMessage = $e->getMessage();
17 $errorCode = $e->getErrorCode();
18 $errorData = $e->getExtraParams();
20 'error' => $errorMessage,
21 'error_code' => $errorCode,
22 'error_data' => $errorData,
30 * Function returns array of result expected from previous function.
35 function uf_field_get_expectedresult() {
37 $expectedResult = array(
45 'uf_group_id' => '11',
46 'field_name' => 'phone',
51 'visibility' => 'Public Pages and Listings',
53 'is_searchable' => '1',
54 'location_type_id' => '1',
55 'phone_type_id' => '1',
56 'label' => 'Test Phone',
57 'field_type' => 'Contact',
58 'is_multi_summary' => 0,
63 return $expectedResult;
67 * This example has been generated from the API test suite.
68 * The test that created it is called "testGetUFFieldSuccess"
69 * and can be found at:
70 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/UFFieldTest.php
72 * You can see the outcome of the API tests at
73 * https://test.civicrm.org/job/CiviCRM-master-git/
75 * To Learn about the API read
76 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
78 * Browse the api on your own site with the api explorer
79 * http://MYSITE.ORG/path/to/civicrm/api
81 * Read more about testing here
82 * http://wiki.civicrm.org/confluence/display/CRM/Testing
84 * API Standards documentation:
85 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards