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:5fb31b058249567562ab0a30a739fda2)
13 * Database access object for the RuleGroup entity.
15 class CRM_Dedupe_DAO_RuleGroup
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.8';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_dedupe_rule_group';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
34 * Unique dedupe rule group id
41 * The type of contacts this group applies to
48 * The weight threshold the sum of the rule weights has to cross to consider two contacts the same
55 * Whether the rule should be used for cases where usage is Unsupervised, Supervised OR General(programatically)
62 * Name of the rule group
69 * Label of the rule group
76 * Is this a reserved rule - a rule group that has been optimized and cannot be changed by the admin
85 public function __construct() {
86 $this->__table
= 'civicrm_dedupe_rule_group';
87 parent
::__construct();
91 * Returns localized title of this entity.
94 * Whether to return the plural version of the title.
96 public static function getEntityTitle($plural = FALSE) {
97 return $plural ?
ts('Rule Groups') : ts('Rule Group');
101 * Returns all the column names of this table
105 public static function &fields() {
106 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
107 Civi
::$statics[__CLASS__
]['fields'] = [
110 'type' => CRM_Utils_Type
::T_INT
,
111 'title' => ts('Rule Group ID'),
112 'description' => ts('Unique dedupe rule group id'),
114 'where' => 'civicrm_dedupe_rule_group.id',
115 'table_name' => 'civicrm_dedupe_rule_group',
116 'entity' => 'RuleGroup',
117 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
122 'name' => 'contact_type',
123 'type' => CRM_Utils_Type
::T_STRING
,
124 'title' => ts('Contact Type'),
125 'description' => ts('The type of contacts this group applies to'),
127 'size' => CRM_Utils_Type
::TWELVE
,
128 'where' => 'civicrm_dedupe_rule_group.contact_type',
129 'table_name' => 'civicrm_dedupe_rule_group',
130 'entity' => 'RuleGroup',
131 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
136 'pseudoconstant' => [
137 'table' => 'civicrm_contact_type',
138 'keyColumn' => 'name',
139 'labelColumn' => 'label',
140 'condition' => 'parent_id IS NULL',
145 'name' => 'threshold',
146 'type' => CRM_Utils_Type
::T_INT
,
147 'title' => ts('Threshold'),
148 'description' => ts('The weight threshold the sum of the rule weights has to cross to consider two contacts the same'),
150 'where' => 'civicrm_dedupe_rule_group.threshold',
151 'table_name' => 'civicrm_dedupe_rule_group',
152 'entity' => 'RuleGroup',
153 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
162 'type' => CRM_Utils_Type
::T_STRING
,
163 'title' => ts('Length'),
164 'description' => ts('Whether the rule should be used for cases where usage is Unsupervised, Supervised OR General(programatically)'),
167 'size' => CRM_Utils_Type
::TWELVE
,
168 'where' => 'civicrm_dedupe_rule_group.used',
169 'table_name' => 'civicrm_dedupe_rule_group',
170 'entity' => 'RuleGroup',
171 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
176 'pseudoconstant' => [
177 'callback' => 'CRM_Core_SelectValues::getDedupeRuleTypes',
183 'type' => CRM_Utils_Type
::T_STRING
,
184 'title' => ts('Name'),
185 'description' => ts('Name of the rule group'),
187 'size' => CRM_Utils_Type
::BIG
,
188 'where' => 'civicrm_dedupe_rule_group.name',
189 'table_name' => 'civicrm_dedupe_rule_group',
190 'entity' => 'RuleGroup',
191 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
197 'type' => CRM_Utils_Type
::T_STRING
,
198 'title' => ts('Title'),
199 'description' => ts('Label of the rule group'),
201 'size' => CRM_Utils_Type
::HUGE
,
202 'where' => 'civicrm_dedupe_rule_group.title',
203 'table_name' => 'civicrm_dedupe_rule_group',
204 'entity' => 'RuleGroup',
205 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
213 'name' => 'is_reserved',
214 'type' => CRM_Utils_Type
::T_BOOLEAN
,
215 'title' => ts('Reserved?'),
216 'description' => ts('Is this a reserved rule - a rule group that has been optimized and cannot be changed by the admin'),
217 'where' => 'civicrm_dedupe_rule_group.is_reserved',
218 'table_name' => 'civicrm_dedupe_rule_group',
219 'entity' => 'RuleGroup',
220 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
223 'type' => 'CheckBox',
228 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
230 return Civi
::$statics[__CLASS__
]['fields'];
234 * Return a mapping from field-name to the corresponding key (as used in fields()).
237 * Array(string $name => string $uniqueName).
239 public static function &fieldKeys() {
240 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
241 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
243 return Civi
::$statics[__CLASS__
]['fieldKeys'];
247 * Returns the names of this table
251 public static function getTableName() {
252 return self
::$_tableName;
256 * Returns if this table needs to be logged
260 public function getLog() {
265 * Returns the list of fields that can be imported
267 * @param bool $prefix
271 public static function &import($prefix = FALSE) {
272 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dedupe_rule_group', $prefix, []);
277 * Returns the list of fields that can be exported
279 * @param bool $prefix
283 public static function &export($prefix = FALSE) {
284 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dedupe_rule_group', $prefix, []);
289 * Returns the list of indices
291 * @param bool $localize
295 public static function indices($localize = TRUE) {
297 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;