5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Dedupe/Rule.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:99420d466d2982510873b69c179fd9f5)
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 static $_tableName = 'civicrm_dedupe_rule';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 foreign keys and entity references.
85 * [CRM_Core_Reference_Interface]
87 public static function getReferenceColumns() {
88 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
89 Civi
::$statics[__CLASS__
]['links'] = static ::createReferenceColumns(__CLASS__
);
90 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'dedupe_rule_group_id', 'civicrm_dedupe_rule_group', 'id');
91 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
93 return Civi
::$statics[__CLASS__
]['links'];
97 * Returns all the column names of this table
101 public static function &fields() {
102 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
103 Civi
::$statics[__CLASS__
]['fields'] = [
106 'type' => CRM_Utils_Type
::T_INT
,
107 'title' => ts('Dedupe Rule ID'),
108 'description' => ts('Unique dedupe rule id'),
110 'table_name' => 'civicrm_dedupe_rule',
112 'bao' => 'CRM_Dedupe_BAO_Rule',
115 'dedupe_rule_group_id' => [
116 'name' => 'dedupe_rule_group_id',
117 'type' => CRM_Utils_Type
::T_INT
,
118 'title' => ts('Dedupe Rule Group'),
119 'description' => ts('The id of the rule group this rule belongs to'),
121 'table_name' => 'civicrm_dedupe_rule',
123 'bao' => 'CRM_Dedupe_BAO_Rule',
125 'FKClassName' => 'CRM_Dedupe_DAO_RuleGroup',
128 'name' => 'rule_table',
129 'type' => CRM_Utils_Type
::T_STRING
,
130 'title' => ts('Rule Table'),
131 'description' => ts('The name of the table this rule is about'),
134 'size' => CRM_Utils_Type
::BIG
,
135 'table_name' => 'civicrm_dedupe_rule',
137 'bao' => 'CRM_Dedupe_BAO_Rule',
141 'name' => 'rule_field',
142 'type' => CRM_Utils_Type
::T_STRING
,
143 'title' => ts('Rule Field'),
144 'description' => ts('The name of the field of the table referenced in rule_table'),
147 'size' => CRM_Utils_Type
::BIG
,
148 'table_name' => 'civicrm_dedupe_rule',
150 'bao' => 'CRM_Dedupe_BAO_Rule',
154 'name' => 'rule_length',
155 'type' => CRM_Utils_Type
::T_INT
,
156 'title' => ts('Rule Length'),
157 'description' => ts('The length of the matching substring'),
158 'table_name' => 'civicrm_dedupe_rule',
160 'bao' => 'CRM_Dedupe_BAO_Rule',
167 'name' => 'rule_weight',
168 'type' => CRM_Utils_Type
::T_INT
,
169 'title' => ts('Order'),
170 'description' => ts('The weight of the rule'),
172 'table_name' => 'civicrm_dedupe_rule',
174 'bao' => 'CRM_Dedupe_BAO_Rule',
181 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
183 return Civi
::$statics[__CLASS__
]['fields'];
187 * Return a mapping from field-name to the corresponding key (as used in fields()).
190 * Array(string $name => string $uniqueName).
192 public static function &fieldKeys() {
193 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
194 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
196 return Civi
::$statics[__CLASS__
]['fieldKeys'];
200 * Returns the names of this table
204 public static function getTableName() {
205 return self
::$_tableName;
209 * Returns if this table needs to be logged
213 public function getLog() {
218 * Returns the list of fields that can be imported
220 * @param bool $prefix
224 public static function &import($prefix = FALSE) {
225 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'dedupe_rule', $prefix, []);
230 * Returns the list of fields that can be exported
232 * @param bool $prefix
236 public static function &export($prefix = FALSE) {
237 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'dedupe_rule', $prefix, []);
242 * Returns the list of indices
244 * @param bool $localize
248 public static function indices($localize = TRUE) {
250 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;