CRM-20312 regenerated DAO with localisation
[civicrm-core.git] / CRM / Dedupe / DAO / Rule.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2017
30 *
31 * Generated from xml/schema/CRM/Dedupe/Rule.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:d4069481ff6f6925ed299206f67ab01e)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 /**
38 * CRM_Dedupe_DAO_Rule constructor.
39 */
40 class CRM_Dedupe_DAO_Rule extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_dedupe_rule';
47 /**
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
49 *
50 * @var boolean
51 */
52 static $_log = false;
53 /**
54 * Unique dedupe rule id
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 * The id of the rule group this rule belongs to
61 *
62 * @var int unsigned
63 */
64 public $dedupe_rule_group_id;
65 /**
66 * The name of the table this rule is about
67 *
68 * @var string
69 */
70 public $rule_table;
71 /**
72 * The name of the field of the table referenced in rule_table
73 *
74 * @var string
75 */
76 public $rule_field;
77 /**
78 * The length of the matching substring
79 *
80 * @var int unsigned
81 */
82 public $rule_length;
83 /**
84 * The weight of the rule
85 *
86 * @var int
87 */
88 public $rule_weight;
89 /**
90 * Class constructor.
91 */
92 function __construct() {
93 $this->__table = 'civicrm_dedupe_rule';
94 parent::__construct();
95 }
96 /**
97 * Returns foreign keys and entity references.
98 *
99 * @return array
100 * [CRM_Core_Reference_Interface]
101 */
102 static function getReferenceColumns() {
103 if (!isset(Civi::$statics[__CLASS__]['links'])) {
104 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
105 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'dedupe_rule_group_id', 'civicrm_dedupe_rule_group', 'id');
106 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
107 }
108 return Civi::$statics[__CLASS__]['links'];
109 }
110 /**
111 * Returns all the column names of this table
112 *
113 * @return array
114 */
115 static function &fields() {
116 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
117 Civi::$statics[__CLASS__]['fields'] = array(
118 'id' => array(
119 'name' => 'id',
120 'type' => CRM_Utils_Type::T_INT,
121 'title' => ts('Dedupe Rule ID') ,
122 'description' => 'Unique dedupe rule id',
123 'required' => true,
124 'table_name' => 'civicrm_dedupe_rule',
125 'entity' => 'Rule',
126 'bao' => 'CRM_Dedupe_BAO_Rule',
127 'localizable' => 0,
128 ) ,
129 'dedupe_rule_group_id' => array(
130 'name' => 'dedupe_rule_group_id',
131 'type' => CRM_Utils_Type::T_INT,
132 'title' => ts('Dedupe Rule Group') ,
133 'description' => 'The id of the rule group this rule belongs to',
134 'required' => true,
135 'table_name' => 'civicrm_dedupe_rule',
136 'entity' => 'Rule',
137 'bao' => 'CRM_Dedupe_BAO_Rule',
138 'localizable' => 0,
139 'FKClassName' => 'CRM_Dedupe_DAO_RuleGroup',
140 ) ,
141 'rule_table' => array(
142 'name' => 'rule_table',
143 'type' => CRM_Utils_Type::T_STRING,
144 'title' => ts('Rule Table') ,
145 'description' => 'The name of the table this rule is about',
146 'required' => true,
147 'maxlength' => 64,
148 'size' => CRM_Utils_Type::BIG,
149 'table_name' => 'civicrm_dedupe_rule',
150 'entity' => 'Rule',
151 'bao' => 'CRM_Dedupe_BAO_Rule',
152 'localizable' => 0,
153 ) ,
154 'rule_field' => array(
155 'name' => 'rule_field',
156 'type' => CRM_Utils_Type::T_STRING,
157 'title' => ts('Rule Field') ,
158 'description' => 'The name of the field of the table referenced in rule_table',
159 'required' => true,
160 'maxlength' => 64,
161 'size' => CRM_Utils_Type::BIG,
162 'table_name' => 'civicrm_dedupe_rule',
163 'entity' => 'Rule',
164 'bao' => 'CRM_Dedupe_BAO_Rule',
165 'localizable' => 0,
166 ) ,
167 'rule_length' => array(
168 'name' => 'rule_length',
169 'type' => CRM_Utils_Type::T_INT,
170 'title' => ts('Rule Length') ,
171 'description' => 'The length of the matching substring',
172 'table_name' => 'civicrm_dedupe_rule',
173 'entity' => 'Rule',
174 'bao' => 'CRM_Dedupe_BAO_Rule',
175 'localizable' => 0,
176 'html' => array(
177 'type' => 'Text',
178 ) ,
179 ) ,
180 'rule_weight' => array(
181 'name' => 'rule_weight',
182 'type' => CRM_Utils_Type::T_INT,
183 'title' => ts('Order') ,
184 'description' => 'The weight of the rule',
185 'required' => true,
186 'table_name' => 'civicrm_dedupe_rule',
187 'entity' => 'Rule',
188 'bao' => 'CRM_Dedupe_BAO_Rule',
189 'localizable' => 0,
190 'html' => array(
191 'type' => 'Text',
192 ) ,
193 ) ,
194 );
195 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
196 }
197 return Civi::$statics[__CLASS__]['fields'];
198 }
199 /**
200 * Return a mapping from field-name to the corresponding key (as used in fields()).
201 *
202 * @return array
203 * Array(string $name => string $uniqueName).
204 */
205 static function &fieldKeys() {
206 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
207 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
208 }
209 return Civi::$statics[__CLASS__]['fieldKeys'];
210 }
211 /**
212 * Returns the names of this table
213 *
214 * @return string
215 */
216 static function getTableName() {
217 return self::$_tableName;
218 }
219 /**
220 * Returns if this table needs to be logged
221 *
222 * @return boolean
223 */
224 function getLog() {
225 return self::$_log;
226 }
227 /**
228 * Returns the list of fields that can be imported
229 *
230 * @param bool $prefix
231 *
232 * @return array
233 */
234 static function &import($prefix = false) {
235 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'dedupe_rule', $prefix, array());
236 return $r;
237 }
238 /**
239 * Returns the list of fields that can be exported
240 *
241 * @param bool $prefix
242 *
243 * @return array
244 */
245 static function &export($prefix = false) {
246 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'dedupe_rule', $prefix, array());
247 return $r;
248 }
249 }