5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Dedupe/RuleGroup.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:2e17168197c3a81d0280c153b668dc6e)
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 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' => ts('Unique dedupe rule group id'),
102 'where' => 'civicrm_dedupe_rule_group.id',
103 'table_name' => 'civicrm_dedupe_rule_group',
104 'entity' => 'RuleGroup',
105 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
109 'name' => 'contact_type',
110 'type' => CRM_Utils_Type
::T_STRING
,
111 'title' => ts('Contact Type'),
112 'description' => ts('The type of contacts this group applies to'),
114 'size' => CRM_Utils_Type
::TWELVE
,
115 'where' => 'civicrm_dedupe_rule_group.contact_type',
116 'table_name' => 'civicrm_dedupe_rule_group',
117 'entity' => 'RuleGroup',
118 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
123 'pseudoconstant' => [
124 'table' => 'civicrm_contact_type',
125 'keyColumn' => 'name',
126 'labelColumn' => 'label',
127 'condition' => 'parent_id IS NULL',
131 'name' => 'threshold',
132 'type' => CRM_Utils_Type
::T_INT
,
133 'title' => ts('Threshold'),
134 'description' => ts('The weight threshold the sum of the rule weights has to cross to consider two contacts the same'),
136 'where' => 'civicrm_dedupe_rule_group.threshold',
137 'table_name' => 'civicrm_dedupe_rule_group',
138 'entity' => 'RuleGroup',
139 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
147 'type' => CRM_Utils_Type
::T_STRING
,
148 'title' => ts('Length'),
149 'description' => ts('Whether the rule should be used for cases where usage is Unsupervised, Supervised OR General(programatically)'),
152 'size' => CRM_Utils_Type
::TWELVE
,
153 'where' => 'civicrm_dedupe_rule_group.used',
154 'table_name' => 'civicrm_dedupe_rule_group',
155 'entity' => 'RuleGroup',
156 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
161 'pseudoconstant' => [
162 'callback' => 'CRM_Core_SelectValues::getDedupeRuleTypes',
167 'type' => CRM_Utils_Type
::T_STRING
,
168 'title' => ts('Name'),
169 'description' => ts('Name of the rule group'),
171 'size' => CRM_Utils_Type
::BIG
,
172 'where' => 'civicrm_dedupe_rule_group.name',
173 'table_name' => 'civicrm_dedupe_rule_group',
174 'entity' => 'RuleGroup',
175 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
180 'type' => CRM_Utils_Type
::T_STRING
,
181 'title' => ts('Title'),
182 'description' => ts('Label of the rule group'),
184 'size' => CRM_Utils_Type
::HUGE
,
185 'where' => 'civicrm_dedupe_rule_group.title',
186 'table_name' => 'civicrm_dedupe_rule_group',
187 'entity' => 'RuleGroup',
188 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
195 'name' => 'is_reserved',
196 'type' => CRM_Utils_Type
::T_BOOLEAN
,
197 'title' => ts('Reserved?'),
198 'description' => ts('Is this a reserved rule - a rule group that has been optimized and cannot be changed by the admin'),
199 'where' => 'civicrm_dedupe_rule_group.is_reserved',
200 'table_name' => 'civicrm_dedupe_rule_group',
201 'entity' => 'RuleGroup',
202 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
205 'type' => 'CheckBox',
209 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
211 return Civi
::$statics[__CLASS__
]['fields'];
215 * Return a mapping from field-name to the corresponding key (as used in fields()).
218 * Array(string $name => string $uniqueName).
220 public static function &fieldKeys() {
221 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
222 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
224 return Civi
::$statics[__CLASS__
]['fieldKeys'];
228 * Returns the names of this table
232 public static function getTableName() {
233 return self
::$_tableName;
237 * Returns if this table needs to be logged
241 public function getLog() {
246 * Returns the list of fields that can be imported
248 * @param bool $prefix
252 public static function &import($prefix = FALSE) {
253 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dedupe_rule_group', $prefix, []);
258 * Returns the list of fields that can be exported
260 * @param bool $prefix
264 public static function &export($prefix = FALSE) {
265 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dedupe_rule_group', $prefix, []);
270 * Returns the list of indices
272 * @param bool $localize
276 public static function indices($localize = TRUE) {
278 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;