/** * To find fields related to a rule group. * * @param array contains the rule group property to identify rule group * * @return rule fields array associated to rule group * @access public */ static function dedupeRuleFields($params) { $rgBao = new CRM_Dedupe_BAO_RuleGroup(); $rgBao->level = $params['level']; $rgBao->contact_type = $params['contact_type']; $rgBao->is_default = 1; $rgBao->find(TRUE); $ruleBao = new CRM_Dedupe_BAO_Rule(); $ruleBao->dedupe_rule_group_id = $rgBao->id; $ruleBao->find(); $ruleFields = array(); while ($ruleBao->fetch()) { $ruleFields[] = $ruleBao->rule_field; } return $ruleFields; }
/** * To find fields related to a rule group. * * @param array contains the rule group property to identify rule group * * @return (rule field => weight) array and threshold associated to rule group * @access public */ function dedupeRuleFieldsWeight($params) { $rgBao = new CRM_Dedupe_BAO_RuleGroup(); $rgBao->level = $params['level']; $rgBao->contact_type = $params['contact_type']; $rgBao->is_default = 1; $rgBao->find(TRUE); $ruleBao = new CRM_Dedupe_BAO_Rule(); $ruleBao->dedupe_rule_group_id = $rgBao->id; $ruleBao->find(); $ruleFields = array(); while ($ruleBao->fetch()) { $ruleFields[$ruleBao->rule_field] = $ruleBao->rule_weight; } return array($ruleFields, $rgBao->threshold); }
/** * find fields related to a rule group. * * @param array $params * * @return array * (rule field => weight) array and threshold associated to rule group */ public static function dedupeRuleFieldsWeight($params) { $rgBao = new CRM_Dedupe_BAO_RuleGroup(); $rgBao->contact_type = $params['contact_type']; if (!empty($params['id'])) { // accept an ID if provided $rgBao->id = $params['id']; } else { $rgBao->used = $params['used']; } $rgBao->find(TRUE); $ruleBao = new CRM_Dedupe_BAO_Rule(); $ruleBao->dedupe_rule_group_id = $rgBao->id; $ruleBao->find(); $ruleFields = array(); while ($ruleBao->fetch()) { $ruleFields[$ruleBao->rule_field] = $ruleBao->rule_weight; } return array($ruleFields, $rgBao->threshold); }
/** * To find fields related to a rule group. * @param array contains the rule group property to identify rule group * * @return rule fields array associated to rule group * @access public */ function dedupeRuleFields($params) { require_once 'CRM/Dedupe/BAO/RuleGroup.php'; $rgBao = new CRM_Dedupe_BAO_RuleGroup(); $rgBao->level = $params['level']; $rgBao->contact_type = $params['contact_type']; $rgBao->is_default = 1; $rgBao->find(true); $ruleBao = new CRM_Dedupe_BAO_Rule(); $ruleBao->dedupe_rule_group_id = $rgBao->id; $ruleBao->find(); $ruleFields = array(); while ($ruleBao->fetch()) { $ruleFields[] = $ruleBao->rule_field; } return $ruleFields; }