3 * Test Generated example demonstrating the CustomValue.get API.
5 * This demonstrates the use of CustomValue get to fetch single and multi-valued custom data.
10 function custom_value_get_example() {
17 $result = civicrm_api3('CustomValue', 'get', $params);
19 catch (CiviCRM_API3_Exception
$e) {
21 $errorMessage = $e->getMessage();
22 $errorCode = $e->getErrorCode();
23 $errorData = $e->getExtraParams();
25 'error' => $errorMessage,
26 'error_code' => $errorCode,
27 'error_data' => $errorData,
35 * Function returns array of result expected from previous function.
40 function custom_value_get_expectedresult() {
49 'latest' => 'value 1',
54 'latest' => 'value 3',
77 '1' => 'defaultValue',
82 'latest' => 'value 4',
97 return $expectedResult;
101 * This example has been generated from the API test suite.
102 * The test that created it is called "testGetMultipleCustomValues"
103 * and can be found at:
104 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/CustomValueTest.php
106 * You can see the outcome of the API tests at
107 * https://test.civicrm.org/job/CiviCRM-master-git/
109 * To Learn about the API read
110 * http://wiki.civicrm.org/confluence/display/CRMDOC/Using+the+API
112 * Browse the api on your own site with the api explorer
113 * http://MYSITE.ORG/path/to/civicrm/api
115 * Read more about testing here
116 * http://wiki.civicrm.org/confluence/display/CRM/Testing
118 * API Standards documentation:
119 * http://wiki.civicrm.org/confluence/display/CRM/API+Architecture+Standards