5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Dedupe/RuleGroup.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:3c21b8b33d8d561b1104318fba0db930)
13 * Database access object for the RuleGroup entity.
15 class CRM_Dedupe_DAO_RuleGroup
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_dedupe_rule_group';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
32 * Unique dedupe rule group id
39 * The type of contacts this group applies to
46 * The weight threshold the sum of the rule weights has to cross to consider two contacts the same
53 * Whether the rule should be used for cases where usage is Unsupervised, Supervised OR General(programatically)
60 * Name of the rule group
67 * Label of the rule group
74 * Is this a reserved rule - a rule group that has been optimized and cannot be changed by the admin
83 public function __construct() {
84 $this->__table
= 'civicrm_dedupe_rule_group';
85 parent
::__construct();
89 * Returns localized title of this entity.
91 public static function getEntityTitle() {
92 return ts('Rule Groups');
96 * Returns all the column names of this table
100 public static function &fields() {
101 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
102 Civi
::$statics[__CLASS__
]['fields'] = [
105 'type' => CRM_Utils_Type
::T_INT
,
106 'title' => ts('Rule Group ID'),
107 'description' => ts('Unique dedupe rule group id'),
109 'where' => 'civicrm_dedupe_rule_group.id',
110 'table_name' => 'civicrm_dedupe_rule_group',
111 'entity' => 'RuleGroup',
112 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
117 'name' => 'contact_type',
118 'type' => CRM_Utils_Type
::T_STRING
,
119 'title' => ts('Contact Type'),
120 'description' => ts('The type of contacts this group applies to'),
122 'size' => CRM_Utils_Type
::TWELVE
,
123 'where' => 'civicrm_dedupe_rule_group.contact_type',
124 'table_name' => 'civicrm_dedupe_rule_group',
125 'entity' => 'RuleGroup',
126 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
131 'pseudoconstant' => [
132 'table' => 'civicrm_contact_type',
133 'keyColumn' => 'name',
134 'labelColumn' => 'label',
135 'condition' => 'parent_id IS NULL',
140 'name' => 'threshold',
141 'type' => CRM_Utils_Type
::T_INT
,
142 'title' => ts('Threshold'),
143 'description' => ts('The weight threshold the sum of the rule weights has to cross to consider two contacts the same'),
145 'where' => 'civicrm_dedupe_rule_group.threshold',
146 'table_name' => 'civicrm_dedupe_rule_group',
147 'entity' => 'RuleGroup',
148 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
157 'type' => CRM_Utils_Type
::T_STRING
,
158 'title' => ts('Length'),
159 'description' => ts('Whether the rule should be used for cases where usage is Unsupervised, Supervised OR General(programatically)'),
162 'size' => CRM_Utils_Type
::TWELVE
,
163 'where' => 'civicrm_dedupe_rule_group.used',
164 'table_name' => 'civicrm_dedupe_rule_group',
165 'entity' => 'RuleGroup',
166 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
171 'pseudoconstant' => [
172 'callback' => 'CRM_Core_SelectValues::getDedupeRuleTypes',
178 'type' => CRM_Utils_Type
::T_STRING
,
179 'title' => ts('Name'),
180 'description' => ts('Name of the rule group'),
182 'size' => CRM_Utils_Type
::BIG
,
183 'where' => 'civicrm_dedupe_rule_group.name',
184 'table_name' => 'civicrm_dedupe_rule_group',
185 'entity' => 'RuleGroup',
186 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
192 'type' => CRM_Utils_Type
::T_STRING
,
193 'title' => ts('Title'),
194 'description' => ts('Label of the rule group'),
196 'size' => CRM_Utils_Type
::HUGE
,
197 'where' => 'civicrm_dedupe_rule_group.title',
198 'table_name' => 'civicrm_dedupe_rule_group',
199 'entity' => 'RuleGroup',
200 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
208 'name' => 'is_reserved',
209 'type' => CRM_Utils_Type
::T_BOOLEAN
,
210 'title' => ts('Reserved?'),
211 'description' => ts('Is this a reserved rule - a rule group that has been optimized and cannot be changed by the admin'),
212 'where' => 'civicrm_dedupe_rule_group.is_reserved',
213 'table_name' => 'civicrm_dedupe_rule_group',
214 'entity' => 'RuleGroup',
215 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
218 'type' => 'CheckBox',
223 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
225 return Civi
::$statics[__CLASS__
]['fields'];
229 * Return a mapping from field-name to the corresponding key (as used in fields()).
232 * Array(string $name => string $uniqueName).
234 public static function &fieldKeys() {
235 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
236 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
238 return Civi
::$statics[__CLASS__
]['fieldKeys'];
242 * Returns the names of this table
246 public static function getTableName() {
247 return self
::$_tableName;
251 * Returns if this table needs to be logged
255 public function getLog() {
260 * Returns the list of fields that can be imported
262 * @param bool $prefix
266 public static function &import($prefix = FALSE) {
267 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dedupe_rule_group', $prefix, []);
272 * Returns the list of fields that can be exported
274 * @param bool $prefix
278 public static function &export($prefix = FALSE) {
279 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dedupe_rule_group', $prefix, []);
284 * Returns the list of indices
286 * @param bool $localize
290 public static function indices($localize = TRUE) {
292 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;