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:77493b98b740fced03c2bca0ab28f567)
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',
116 'name' => 'contact_type',
117 'type' => CRM_Utils_Type
::T_STRING
,
118 'title' => ts('Contact Type'),
119 'description' => ts('The type of contacts this group applies to'),
121 'size' => CRM_Utils_Type
::TWELVE
,
122 'where' => 'civicrm_dedupe_rule_group.contact_type',
123 'table_name' => 'civicrm_dedupe_rule_group',
124 'entity' => 'RuleGroup',
125 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
130 'pseudoconstant' => [
131 'table' => 'civicrm_contact_type',
132 'keyColumn' => 'name',
133 'labelColumn' => 'label',
134 'condition' => 'parent_id IS NULL',
138 'name' => 'threshold',
139 'type' => CRM_Utils_Type
::T_INT
,
140 'title' => ts('Threshold'),
141 'description' => ts('The weight threshold the sum of the rule weights has to cross to consider two contacts the same'),
143 'where' => 'civicrm_dedupe_rule_group.threshold',
144 'table_name' => 'civicrm_dedupe_rule_group',
145 'entity' => 'RuleGroup',
146 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
154 'type' => CRM_Utils_Type
::T_STRING
,
155 'title' => ts('Length'),
156 'description' => ts('Whether the rule should be used for cases where usage is Unsupervised, Supervised OR General(programatically)'),
159 'size' => CRM_Utils_Type
::TWELVE
,
160 'where' => 'civicrm_dedupe_rule_group.used',
161 'table_name' => 'civicrm_dedupe_rule_group',
162 'entity' => 'RuleGroup',
163 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
168 'pseudoconstant' => [
169 'callback' => 'CRM_Core_SelectValues::getDedupeRuleTypes',
174 'type' => CRM_Utils_Type
::T_STRING
,
175 'title' => ts('Name'),
176 'description' => ts('Name of the rule group'),
178 'size' => CRM_Utils_Type
::BIG
,
179 'where' => 'civicrm_dedupe_rule_group.name',
180 'table_name' => 'civicrm_dedupe_rule_group',
181 'entity' => 'RuleGroup',
182 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
187 'type' => CRM_Utils_Type
::T_STRING
,
188 'title' => ts('Title'),
189 'description' => ts('Label of the rule group'),
191 'size' => CRM_Utils_Type
::HUGE
,
192 'where' => 'civicrm_dedupe_rule_group.title',
193 'table_name' => 'civicrm_dedupe_rule_group',
194 'entity' => 'RuleGroup',
195 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
202 'name' => 'is_reserved',
203 'type' => CRM_Utils_Type
::T_BOOLEAN
,
204 'title' => ts('Reserved?'),
205 'description' => ts('Is this a reserved rule - a rule group that has been optimized and cannot be changed by the admin'),
206 'where' => 'civicrm_dedupe_rule_group.is_reserved',
207 'table_name' => 'civicrm_dedupe_rule_group',
208 'entity' => 'RuleGroup',
209 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
212 'type' => 'CheckBox',
216 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
218 return Civi
::$statics[__CLASS__
]['fields'];
222 * Return a mapping from field-name to the corresponding key (as used in fields()).
225 * Array(string $name => string $uniqueName).
227 public static function &fieldKeys() {
228 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
229 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
231 return Civi
::$statics[__CLASS__
]['fieldKeys'];
235 * Returns the names of this table
239 public static function getTableName() {
240 return self
::$_tableName;
244 * Returns if this table needs to be logged
248 public function getLog() {
253 * Returns the list of fields that can be imported
255 * @param bool $prefix
259 public static function &import($prefix = FALSE) {
260 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dedupe_rule_group', $prefix, []);
265 * Returns the list of fields that can be exported
267 * @param bool $prefix
271 public static function &export($prefix = FALSE) {
272 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dedupe_rule_group', $prefix, []);
277 * Returns the list of indices
279 * @param bool $localize
283 public static function indices($localize = TRUE) {
285 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;