3 * Test Generated example demonstrating the OptionValue.get API.
8 function option_value_get_example() {
10 'option_group_id' => 1,
14 $result = civicrm_api3('OptionValue', 'get', $params);
16 catch (CiviCRM_API3_Exception
$e) {
18 $errorMessage = $e->getMessage();
19 $errorCode = $e->getErrorCode();
20 $errorData = $e->getExtraParams();
23 'error_message' => $errorMessage,
24 'error_code' => $errorCode,
25 'error_data' => $errorData,
33 * Function returns array of result expected from previous function.
38 function option_value_get_expectedresult() {
47 'option_group_id' => '1',
59 'option_group_id' => '1',
71 'option_group_id' => '1',
72 'label' => 'Postal Mail',
74 'name' => 'Postal Mail',
83 'option_group_id' => '1',
95 'option_group_id' => '1',
108 return $expectedResult;
112 * This example has been generated from the API test suite.
113 * The test that created it is called "testGetOptionGroup"
114 * and can be found at:
115 * https://github.com/civicrm/civicrm-core/blob/master/tests/phpunit/api/v3/OptionValueTest.php
117 * You can see the outcome of the API tests at
118 * https://test.civicrm.org/job/CiviCRM-Core-Matrix/
120 * To Learn about the API read
121 * https://docs.civicrm.org/dev/en/latest/api/
123 * Browse the API on your own site with the API Explorer. It is in the main
124 * CiviCRM menu, under: Support > Development > API Explorer.
126 * Read more about testing here
127 * https://docs.civicrm.org/dev/en/latest/testing/
129 * API Standards documentation:
130 * https://docs.civicrm.org/dev/en/latest/framework/api-architecture/