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:a96207fdef11a959a8d900e1dc76a15c)
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',
126 'name' => 'contact_type',
127 'type' => CRM_Utils_Type
::T_STRING
,
128 'title' => ts('Contact Type'),
129 'description' => ts('The type of contacts this group applies to'),
131 'size' => CRM_Utils_Type
::TWELVE
,
132 'where' => 'civicrm_dedupe_rule_group.contact_type',
133 'table_name' => 'civicrm_dedupe_rule_group',
134 'entity' => 'RuleGroup',
135 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
140 'pseudoconstant' => [
141 'table' => 'civicrm_contact_type',
142 'keyColumn' => 'name',
143 'labelColumn' => 'label',
144 'condition' => 'parent_id IS NULL',
149 'name' => 'threshold',
150 'type' => CRM_Utils_Type
::T_INT
,
151 'title' => ts('Threshold'),
152 'description' => ts('The weight threshold the sum of the rule weights has to cross to consider two contacts the same'),
154 'where' => 'civicrm_dedupe_rule_group.threshold',
155 'table_name' => 'civicrm_dedupe_rule_group',
156 'entity' => 'RuleGroup',
157 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
166 'type' => CRM_Utils_Type
::T_STRING
,
167 'title' => ts('Length'),
168 'description' => ts('Whether the rule should be used for cases where usage is Unsupervised, Supervised OR General(programatically)'),
171 'size' => CRM_Utils_Type
::TWELVE
,
172 'where' => 'civicrm_dedupe_rule_group.used',
173 'table_name' => 'civicrm_dedupe_rule_group',
174 'entity' => 'RuleGroup',
175 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
180 'pseudoconstant' => [
181 'callback' => 'CRM_Core_SelectValues::getDedupeRuleTypes',
187 'type' => CRM_Utils_Type
::T_STRING
,
188 'title' => ts('Name'),
189 'description' => ts('Name of the rule group'),
191 'size' => CRM_Utils_Type
::BIG
,
192 'where' => 'civicrm_dedupe_rule_group.name',
193 'table_name' => 'civicrm_dedupe_rule_group',
194 'entity' => 'RuleGroup',
195 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
201 'type' => CRM_Utils_Type
::T_STRING
,
202 'title' => ts('Title'),
203 'description' => ts('Label of the rule group'),
205 'size' => CRM_Utils_Type
::HUGE
,
206 'where' => 'civicrm_dedupe_rule_group.title',
207 'table_name' => 'civicrm_dedupe_rule_group',
208 'entity' => 'RuleGroup',
209 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
217 'name' => 'is_reserved',
218 'type' => CRM_Utils_Type
::T_BOOLEAN
,
219 'title' => ts('Reserved?'),
220 'description' => ts('Is this a reserved rule - a rule group that has been optimized and cannot be changed by the admin'),
221 'where' => 'civicrm_dedupe_rule_group.is_reserved',
222 'table_name' => 'civicrm_dedupe_rule_group',
223 'entity' => 'RuleGroup',
224 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
227 'type' => 'CheckBox',
232 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
234 return Civi
::$statics[__CLASS__
]['fields'];
238 * Return a mapping from field-name to the corresponding key (as used in fields()).
241 * Array(string $name => string $uniqueName).
243 public static function &fieldKeys() {
244 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
245 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
247 return Civi
::$statics[__CLASS__
]['fieldKeys'];
251 * Returns the names of this table
255 public static function getTableName() {
256 return self
::$_tableName;
260 * Returns if this table needs to be logged
264 public function getLog() {
269 * Returns the list of fields that can be imported
271 * @param bool $prefix
275 public static function &import($prefix = FALSE) {
276 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dedupe_rule_group', $prefix, []);
281 * Returns the list of fields that can be exported
283 * @param bool $prefix
287 public static function &export($prefix = FALSE) {
288 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dedupe_rule_group', $prefix, []);
293 * Returns the list of indices
295 * @param bool $localize
299 public static function indices($localize = TRUE) {
301 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;