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 (dedupe) rules.
15 * Rules dedupe critieria assigned to RuleGroups.
17 * @package CiviCRM_APIv3
21 * Create or update a rule.
23 * @param array $params
24 * Array per getfields metadata.
29 function civicrm_api3_rule_create($params) {
30 return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__
), $params, 'Rule');
34 * Specify Meta data for create.
36 * Note that this data is retrievable via the getfields function
37 * and is used for pre-filling defaults and ensuring mandatory requirements are met.
39 * @param array $params
41 function _civicrm_api3_rule_create_spec(&$params) {
42 $params['dedupe_rule_group_id']['api.required'] = TRUE;
43 $params['rule_table']['api.default'] = 'civicrm_contact';
44 $params['rule_field']['api.required'] = TRUE;
45 $params['rule_weight']['api.required'] = TRUE;
49 * Delete an existing Rule.
51 * @param array $params
56 function civicrm_api3_rule_delete($params) {
57 return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__
), $params);
63 * @param array $params
64 * Array per getfields metadata.
69 function civicrm_api3_rule_get($params) {
70 return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__
), $params, TRUE, 'Rule');