5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Dedupe/RuleGroup.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:0f103fb52cf7d96d601d83e8417f77ad)
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 static $_tableName = 'civicrm_dedupe_rule_group';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 all the column names of this table
93 public static function &fields() {
94 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
95 Civi
::$statics[__CLASS__
]['fields'] = [
98 'type' => CRM_Utils_Type
::T_INT
,
99 'title' => ts('Rule Group ID'),
100 'description' => 'Unique dedupe rule group id',
102 'table_name' => 'civicrm_dedupe_rule_group',
103 'entity' => 'RuleGroup',
104 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
108 'name' => 'contact_type',
109 'type' => CRM_Utils_Type
::T_STRING
,
110 'title' => ts('Contact Type'),
111 'description' => 'The type of contacts this group applies to',
113 'size' => CRM_Utils_Type
::TWELVE
,
114 'table_name' => 'civicrm_dedupe_rule_group',
115 'entity' => 'RuleGroup',
116 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
121 'pseudoconstant' => [
122 'table' => 'civicrm_contact_type',
123 'keyColumn' => 'name',
124 'labelColumn' => 'label',
125 'condition' => 'parent_id IS NULL',
129 'name' => 'threshold',
130 'type' => CRM_Utils_Type
::T_INT
,
131 'title' => ts('Threshold'),
132 'description' => 'The weight threshold the sum of the rule weights has to cross to consider two contacts the same',
134 'table_name' => 'civicrm_dedupe_rule_group',
135 'entity' => 'RuleGroup',
136 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
144 'type' => CRM_Utils_Type
::T_STRING
,
145 'title' => ts('Length'),
146 'description' => 'Whether the rule should be used for cases where usage is Unsupervised, Supervised OR General(programatically)',
149 'size' => CRM_Utils_Type
::TWELVE
,
150 'table_name' => 'civicrm_dedupe_rule_group',
151 'entity' => 'RuleGroup',
152 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
157 'pseudoconstant' => [
158 'callback' => 'CRM_Core_SelectValues::getDedupeRuleTypes',
163 'type' => CRM_Utils_Type
::T_STRING
,
164 'title' => ts('Name'),
165 'description' => 'Name of the rule group',
167 'size' => CRM_Utils_Type
::BIG
,
168 'table_name' => 'civicrm_dedupe_rule_group',
169 'entity' => 'RuleGroup',
170 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
175 'type' => CRM_Utils_Type
::T_STRING
,
176 'title' => ts('Title'),
177 'description' => 'Label of the rule group',
179 'size' => CRM_Utils_Type
::HUGE
,
180 'table_name' => 'civicrm_dedupe_rule_group',
181 'entity' => 'RuleGroup',
182 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
189 'name' => 'is_reserved',
190 'type' => CRM_Utils_Type
::T_BOOLEAN
,
191 'title' => ts('Reserved?'),
192 'description' => 'Is this a reserved rule - a rule group that has been optimized and cannot be changed by the admin',
193 'table_name' => 'civicrm_dedupe_rule_group',
194 'entity' => 'RuleGroup',
195 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
198 'type' => 'CheckBox',
202 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
204 return Civi
::$statics[__CLASS__
]['fields'];
208 * Return a mapping from field-name to the corresponding key (as used in fields()).
211 * Array(string $name => string $uniqueName).
213 public static function &fieldKeys() {
214 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
215 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
217 return Civi
::$statics[__CLASS__
]['fieldKeys'];
221 * Returns the names of this table
225 public static function getTableName() {
226 return self
::$_tableName;
230 * Returns if this table needs to be logged
234 public function getLog() {
239 * Returns the list of fields that can be imported
241 * @param bool $prefix
245 public static function &import($prefix = FALSE) {
246 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dedupe_rule_group', $prefix, []);
251 * Returns the list of fields that can be exported
253 * @param bool $prefix
257 public static function &export($prefix = FALSE) {
258 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dedupe_rule_group', $prefix, []);
263 * Returns the list of indices
265 * @param bool $localize
269 public static function indices($localize = TRUE) {
271 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;