3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
13 * This api exposes CiviCRM WordReplacement records.
15 * Word replacements are used to globally alter strings in the CiviCRM UI.
16 * Note that the original source string is always English, regardless of language settings.
18 * @package CiviCRM_APIv3
22 * Get CiviCRM Word Replacement details.
24 * @param array $params
27 * @throws \API_Exception
29 function civicrm_api3_word_replacement_get($params) {
30 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__
), $params);
34 * Create a new Word Replacement.
36 * @param array $params
40 function civicrm_api3_word_replacement_create($params) {
41 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params, 'WordReplacement');
45 * Adjust Metadata for Create action.
47 * The metadata is used for setting defaults, documentation & validation.
49 * @param array $params
50 * Array of parameters determined by getfields.
52 function _civicrm_api3_word_replacement_create_spec(&$params) {
53 $params['find_word']['api.required'] = 1;
54 $params['replace_word']['api.required'] = 1;
55 $params['is_active']['api.default'] = 1;
59 * Delete an existing WordReplacement.
61 * @param array $params
62 * Array containing id of the WordReplacement to be deleted.
67 function civicrm_api3_word_replacement_delete($params) {
68 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__
), $params);