3 * Test Generated example of using custom_value get API.
10 function custom_value_get_example() {
14 'format.field_names' => 1,
18 $result = civicrm_api3('custom_value', 'get', $params);
20 catch (CiviCRM_API3_Exception
$e) {
22 $errorMessage = $e->getMessage();
23 $errorCode = $e->getErrorCode();
24 $errorData = $e->getExtraParams();
26 'error' => $errorMessage,
27 'error_code' => $errorCode,
28 'error_data' => $errorData,
36 * Function returns array of result expected from previous function.
41 function custom_value_get_expectedresult() {
43 $expectedResult = array(
48 'mySingleField' => array(
50 'latest' => 'value 1',
51 'id' => 'mySingleField',
55 'latest' => 'value 3',
78 '1' => 'defaultValue',
83 'latest' => 'value 4',
98 return $expectedResult;
102 * This example has been generated from the API test suite.
103 * The test that created it is called
104 * testGetMultipleCustomValues
105 * and can be found in
106 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomValueTest.php
108 * You can see the outcome of the API tests at
109 * https://test.civicrm.org/job/CiviCRM-master-git/
111 * To Learn about the API read
112 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
114 * Browse the api on your own site with the api explorer
115 * http://MYSITE.ORG/path/to/civicrm/api
117 * Read more about testing here
118 * http://wiki.civicrm.org/confluence/display/CRM/Testing
120 * API Standards documentation:
121 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards