5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Dedupe/DedupeRule.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:782d96ecc76d4020270fce04574a39b5)
13 * Database access object for the DedupeRule entity.
15 class CRM_Dedupe_DAO_DedupeRule
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';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
34 * Unique dedupe rule id
41 * The id of the rule group this rule belongs to
45 public $dedupe_rule_group_id;
48 * The name of the table this rule is about
55 * The name of the field of the table referenced in rule_table
62 * The length of the matching substring
69 * The weight of the rule
78 public function __construct() {
79 $this->__table
= 'civicrm_dedupe_rule';
80 parent
::__construct();
84 * Returns localized title of this entity.
87 * Whether to return the plural version of the title.
89 public static function getEntityTitle($plural = FALSE) {
90 return $plural ?
ts('Dedupe Rules') : ts('Dedupe Rule');
94 * Returns foreign keys and entity references.
97 * [CRM_Core_Reference_Interface]
99 public static function getReferenceColumns() {
100 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
101 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
102 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'dedupe_rule_group_id', 'civicrm_dedupe_rule_group', 'id');
103 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
105 return Civi
::$statics[__CLASS__
]['links'];
109 * Returns all the column names of this table
113 public static function &fields() {
114 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
115 Civi
::$statics[__CLASS__
]['fields'] = [
118 'type' => CRM_Utils_Type
::T_INT
,
119 'title' => ts('Dedupe Rule ID'),
120 'description' => ts('Unique dedupe rule id'),
122 'where' => 'civicrm_dedupe_rule.id',
123 'table_name' => 'civicrm_dedupe_rule',
124 'entity' => 'DedupeRule',
125 'bao' => 'CRM_Dedupe_BAO_DedupeRule',
133 'dedupe_rule_group_id' => [
134 'name' => 'dedupe_rule_group_id',
135 'type' => CRM_Utils_Type
::T_INT
,
136 'title' => ts('Group ID'),
137 'description' => ts('The id of the rule group this rule belongs to'),
139 'where' => 'civicrm_dedupe_rule.dedupe_rule_group_id',
140 'table_name' => 'civicrm_dedupe_rule',
141 'entity' => 'DedupeRule',
142 'bao' => 'CRM_Dedupe_BAO_DedupeRule',
144 'FKClassName' => 'CRM_Dedupe_DAO_DedupeRuleGroup',
146 'label' => ts("Group"),
151 'name' => 'rule_table',
152 'type' => CRM_Utils_Type
::T_STRING
,
153 'title' => ts('Rule Table'),
154 'description' => ts('The name of the table this rule is about'),
157 'size' => CRM_Utils_Type
::BIG
,
158 'where' => 'civicrm_dedupe_rule.rule_table',
159 'table_name' => 'civicrm_dedupe_rule',
160 'entity' => 'DedupeRule',
161 'bao' => 'CRM_Dedupe_BAO_DedupeRule',
166 'name' => 'rule_field',
167 'type' => CRM_Utils_Type
::T_STRING
,
168 'title' => ts('Rule Field'),
169 'description' => ts('The name of the field of the table referenced in rule_table'),
172 'size' => CRM_Utils_Type
::BIG
,
173 'where' => 'civicrm_dedupe_rule.rule_field',
174 'table_name' => 'civicrm_dedupe_rule',
175 'entity' => 'DedupeRule',
176 'bao' => 'CRM_Dedupe_BAO_DedupeRule',
181 'name' => 'rule_length',
182 'type' => CRM_Utils_Type
::T_INT
,
183 'title' => ts('Rule Length'),
184 'description' => ts('The length of the matching substring'),
185 'where' => 'civicrm_dedupe_rule.rule_length',
186 'table_name' => 'civicrm_dedupe_rule',
187 'entity' => 'DedupeRule',
188 'bao' => 'CRM_Dedupe_BAO_DedupeRule',
196 'name' => 'rule_weight',
197 'type' => CRM_Utils_Type
::T_INT
,
198 'title' => ts('Order'),
199 'description' => ts('The weight of the rule'),
201 'where' => 'civicrm_dedupe_rule.rule_weight',
202 'table_name' => 'civicrm_dedupe_rule',
203 'entity' => 'DedupeRule',
204 'bao' => 'CRM_Dedupe_BAO_DedupeRule',
212 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
214 return Civi
::$statics[__CLASS__
]['fields'];
218 * Return a mapping from field-name to the corresponding key (as used in fields()).
221 * Array(string $name => string $uniqueName).
223 public static function &fieldKeys() {
224 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
225 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
227 return Civi
::$statics[__CLASS__
]['fieldKeys'];
231 * Returns the names of this table
235 public static function getTableName() {
236 return self
::$_tableName;
240 * Returns if this table needs to be logged
244 public function getLog() {
249 * Returns the list of fields that can be imported
251 * @param bool $prefix
255 public static function &import($prefix = FALSE) {
256 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dedupe_rule', $prefix, []);
261 * Returns the list of fields that can be exported
263 * @param bool $prefix
267 public static function &export($prefix = FALSE) {
268 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dedupe_rule', $prefix, []);
273 * Returns the list of indices
275 * @param bool $localize
279 public static function indices($localize = TRUE) {
281 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;