3 * Test Generated example demonstrating the CustomValue.get API.
10 function custom_value_get_example() {
14 'format.field_names' => 1,
18 $result = civicrm_api3('CustomValue', '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 "testGetMultipleCustomValues"
104 * and can be found at:
105 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomValueTest.php
107 * You can see the outcome of the API tests at
108 * https://test.civicrm.org/job/CiviCRM-master-git/
110 * To Learn about the API read
111 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
113 * Browse the api on your own site with the api explorer
114 * http://MYSITE.ORG/path/to/civicrm/api
116 * Read more about testing here
117 * http://wiki.civicrm.org/confluence/display/CRM/Testing
119 * API Standards documentation:
120 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards