4 * Test Generated API Example.
5 * See bottom of this file for more detail.
9 * Test Generated example of using custom_value get API.
11 * utilises field names
16 function custom_value_get_example() {
20 'format.field_names' => 1,
24 $result = civicrm_api3('custom_value', 'get', $params);
26 catch (CiviCRM_API3_Exception
$e) {
28 $errorMessage = $e->getMessage();
29 $errorCode = $e->getErrorCode();
30 $errorData = $e->getExtraParams();
32 'error' => $errorMessage,
33 'error_code' => $errorCode,
34 'error_data' => $errorData,
42 * Function returns array of result expected from previous function.
47 function custom_value_get_expectedresult() {
49 $expectedResult = array(
54 'mySingleField' => array(
56 'latest' => 'value 1',
57 'id' => 'mySingleField',
61 'latest' => 'value 3',
84 '1' => 'defaultValue',
89 'latest' => 'value 4',
104 return $expectedResult;
108 * This example has been generated from the API test suite.
109 * The test that created it is called
110 * testGetMultipleCustomValues
111 * and can be found in
112 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomValueTest.php
114 * You can see the outcome of the API tests at
115 * https://test.civicrm.org/job/CiviCRM-master-git/
117 * To Learn about the API read
118 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
120 * Browse the api on your own site with the api explorer
121 * http://MYSITE.ORG/path/to/civicrm/api/explorer
123 * Read more about testing here
124 * http://wiki.civicrm.org/confluence/display/CRM/Testing
126 * API Standards documentation:
127 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards