5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Dedupe/Rule.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:78004d786287419f4f322dd22c8e7daa)
13 * Database access object for the Rule entity.
15 class CRM_Dedupe_DAO_Rule
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_dedupe_rule';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
32 * Unique dedupe rule id
39 * The id of the rule group this rule belongs to
43 public $dedupe_rule_group_id;
46 * The name of the table this rule is about
53 * The name of the field of the table referenced in rule_table
60 * The length of the matching substring
67 * The weight of the rule
76 public function __construct() {
77 $this->__table
= 'civicrm_dedupe_rule';
78 parent
::__construct();
82 * Returns localized title of this entity.
84 public static function getEntityTitle() {
89 * Returns foreign keys and entity references.
92 * [CRM_Core_Reference_Interface]
94 public static function getReferenceColumns() {
95 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
96 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
97 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'dedupe_rule_group_id', 'civicrm_dedupe_rule_group', 'id');
98 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
100 return Civi
::$statics[__CLASS__
]['links'];
104 * Returns all the column names of this table
108 public static function &fields() {
109 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
110 Civi
::$statics[__CLASS__
]['fields'] = [
113 'type' => CRM_Utils_Type
::T_INT
,
114 'title' => ts('Dedupe Rule ID'),
115 'description' => ts('Unique dedupe rule id'),
117 'where' => 'civicrm_dedupe_rule.id',
118 'table_name' => 'civicrm_dedupe_rule',
120 'bao' => 'CRM_Dedupe_BAO_Rule',
123 'dedupe_rule_group_id' => [
124 'name' => 'dedupe_rule_group_id',
125 'type' => CRM_Utils_Type
::T_INT
,
126 'title' => ts('Dedupe Rule Group'),
127 'description' => ts('The id of the rule group this rule belongs to'),
129 'where' => 'civicrm_dedupe_rule.dedupe_rule_group_id',
130 'table_name' => 'civicrm_dedupe_rule',
132 'bao' => 'CRM_Dedupe_BAO_Rule',
134 'FKClassName' => 'CRM_Dedupe_DAO_RuleGroup',
137 'name' => 'rule_table',
138 'type' => CRM_Utils_Type
::T_STRING
,
139 'title' => ts('Rule Table'),
140 'description' => ts('The name of the table this rule is about'),
143 'size' => CRM_Utils_Type
::BIG
,
144 'where' => 'civicrm_dedupe_rule.rule_table',
145 'table_name' => 'civicrm_dedupe_rule',
147 'bao' => 'CRM_Dedupe_BAO_Rule',
151 'name' => 'rule_field',
152 'type' => CRM_Utils_Type
::T_STRING
,
153 'title' => ts('Rule Field'),
154 'description' => ts('The name of the field of the table referenced in rule_table'),
157 'size' => CRM_Utils_Type
::BIG
,
158 'where' => 'civicrm_dedupe_rule.rule_field',
159 'table_name' => 'civicrm_dedupe_rule',
161 'bao' => 'CRM_Dedupe_BAO_Rule',
165 'name' => 'rule_length',
166 'type' => CRM_Utils_Type
::T_INT
,
167 'title' => ts('Rule Length'),
168 'description' => ts('The length of the matching substring'),
169 'where' => 'civicrm_dedupe_rule.rule_length',
170 'table_name' => 'civicrm_dedupe_rule',
172 'bao' => 'CRM_Dedupe_BAO_Rule',
179 'name' => 'rule_weight',
180 'type' => CRM_Utils_Type
::T_INT
,
181 'title' => ts('Order'),
182 'description' => ts('The weight of the rule'),
184 'where' => 'civicrm_dedupe_rule.rule_weight',
185 'table_name' => 'civicrm_dedupe_rule',
187 'bao' => 'CRM_Dedupe_BAO_Rule',
194 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
196 return Civi
::$statics[__CLASS__
]['fields'];
200 * Return a mapping from field-name to the corresponding key (as used in fields()).
203 * Array(string $name => string $uniqueName).
205 public static function &fieldKeys() {
206 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
207 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
209 return Civi
::$statics[__CLASS__
]['fieldKeys'];
213 * Returns the names of this table
217 public static function getTableName() {
218 return self
::$_tableName;
222 * Returns if this table needs to be logged
226 public function getLog() {
231 * Returns the list of fields that can be imported
233 * @param bool $prefix
237 public static function &import($prefix = FALSE) {
238 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dedupe_rule', $prefix, []);
243 * Returns the list of fields that can be exported
245 * @param bool $prefix
249 public static function &export($prefix = FALSE) {
250 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dedupe_rule', $prefix, []);
255 * Returns the list of indices
257 * @param bool $localize
261 public static function indices($localize = TRUE) {
263 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;