4 * Retrieve a CustomSearches
6 * FIXME This is a bare-minimum placeholder
10 * @internal param $array $ params input parameters
12 * {@example OptionValueGet.php 0}
13 * @example OptionValueGet.php
15 * @return array details of found Option Values
16 * {@getfields OptionValue_get}
19 function civicrm_api3_custom_search_get($params) {
20 require_once 'api/v3/OptionValue.php';
21 $params['option_group_id'] = CRM_Core_DAO
::getFieldValue(
22 'CRM_Core_DAO_OptionGroup', 'custom_search', 'id', 'name'
24 return civicrm_api3_option_value_get($params);
30 * Allowed @params array keys are:
32 * {@example OptionValueCreate.php}
36 * @return array of newly created option_value property values.
37 * {@getfields OptionValue_create}
40 function civicrm_api3_custom_search_create($params) {
41 require_once 'api/v3/OptionValue.php';
42 $params['option_group_id'] = CRM_Core_DAO
::getFieldValue(
43 'CRM_Core_DAO_OptionGroup', 'custom_search', 'id', 'name'
45 // empirically, class name goes to both 'name' and 'label'
46 if (array_key_exists('name', $params)) {
47 $params['label'] = $params['name'];
49 return civicrm_api3_option_value_create($params);
53 * Adjust Metadata for Create action
55 * The metadata is used for setting defaults, documentation & validation
56 * @param array $params array or parameters determined by getfields
58 function _civicrm_api3_custom_search_create_spec(&$params) {
59 require_once 'api/v3/OptionValue.php';
60 _civicrm_api3_option_value_create_spec($params);
61 $params['option_group_id']['api.default'] = CRM_Core_DAO
::getFieldValue(
62 'CRM_Core_DAO_OptionGroup', 'custom_search', 'id', 'name'
64 $params['name']['api.aliases'] = array('class_name');
68 * Deletes an existing ReportTemplate
70 * @param array $params
72 * {@example ReportTemplateDelete.php 0}
74 * @return array Api result
75 * {@getfields ReportTemplate_create}
78 function civicrm_api3_custom_search_delete($params) {
79 require_once 'api/v3/OptionValue.php';
80 return civicrm_api3_option_value_delete($params);