CRM-20312 regenerated DAOS with indexes
[civicrm-core.git] / CRM / Dedupe / DAO / RuleGroup.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/RuleGroup.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:0f103fb52cf7d96d601d83e8417f77ad)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 /**
38 * CRM_Dedupe_DAO_RuleGroup constructor.
39 */
40 class CRM_Dedupe_DAO_RuleGroup extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_dedupe_rule_group';
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 group id
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 * The type of contacts this group applies to
61 *
62 * @var string
63 */
64 public $contact_type;
65 /**
66 * The weight threshold the sum of the rule weights has to cross to consider two contacts the same
67 *
68 * @var int
69 */
70 public $threshold;
71 /**
72 * Whether the rule should be used for cases where usage is Unsupervised, Supervised OR General(programatically)
73 *
74 * @var string
75 */
76 public $used;
77 /**
78 * Name of the rule group
79 *
80 * @var string
81 */
82 public $name;
83 /**
84 * Label of the rule group
85 *
86 * @var string
87 */
88 public $title;
89 /**
90 * Is this a reserved rule - a rule group that has been optimized and cannot be changed by the admin
91 *
92 * @var boolean
93 */
94 public $is_reserved;
95 /**
96 * Class constructor.
97 */
98 function __construct() {
99 $this->__table = 'civicrm_dedupe_rule_group';
100 parent::__construct();
101 }
102 /**
103 * Returns all the column names of this table
104 *
105 * @return array
106 */
107 static function &fields() {
108 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
109 Civi::$statics[__CLASS__]['fields'] = array(
110 'id' => array(
111 'name' => 'id',
112 'type' => CRM_Utils_Type::T_INT,
113 'title' => ts('Rule Group ID') ,
114 'description' => 'Unique dedupe rule group id',
115 'required' => true,
116 'table_name' => 'civicrm_dedupe_rule_group',
117 'entity' => 'RuleGroup',
118 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
119 'localizable' => 0,
120 ) ,
121 'contact_type' => array(
122 'name' => 'contact_type',
123 'type' => CRM_Utils_Type::T_STRING,
124 'title' => ts('Contact Type') ,
125 'description' => 'The type of contacts this group applies to',
126 'maxlength' => 12,
127 'size' => CRM_Utils_Type::TWELVE,
128 'table_name' => 'civicrm_dedupe_rule_group',
129 'entity' => 'RuleGroup',
130 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
131 'localizable' => 0,
132 'html' => array(
133 'type' => 'Select',
134 ) ,
135 'pseudoconstant' => array(
136 'table' => 'civicrm_contact_type',
137 'keyColumn' => 'name',
138 'labelColumn' => 'label',
139 'condition' => 'parent_id IS NULL',
140 )
141 ) ,
142 'threshold' => array(
143 'name' => 'threshold',
144 'type' => CRM_Utils_Type::T_INT,
145 'title' => ts('Threshold') ,
146 'description' => 'The weight threshold the sum of the rule weights has to cross to consider two contacts the same',
147 'required' => true,
148 'table_name' => 'civicrm_dedupe_rule_group',
149 'entity' => 'RuleGroup',
150 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
151 'localizable' => 0,
152 'html' => array(
153 'type' => 'Text',
154 ) ,
155 ) ,
156 'used' => array(
157 'name' => 'used',
158 'type' => CRM_Utils_Type::T_STRING,
159 'title' => ts('Length') ,
160 'description' => 'Whether the rule should be used for cases where usage is Unsupervised, Supervised OR General(programatically)',
161 'required' => true,
162 'maxlength' => 12,
163 'size' => CRM_Utils_Type::TWELVE,
164 'table_name' => 'civicrm_dedupe_rule_group',
165 'entity' => 'RuleGroup',
166 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
167 'localizable' => 0,
168 'html' => array(
169 'type' => 'Radio',
170 ) ,
171 'pseudoconstant' => array(
172 'callback' => 'CRM_Core_SelectValues::getDedupeRuleTypes',
173 )
174 ) ,
175 'name' => array(
176 'name' => 'name',
177 'type' => CRM_Utils_Type::T_STRING,
178 'title' => ts('Name') ,
179 'description' => 'Name of the rule group',
180 'maxlength' => 64,
181 'size' => CRM_Utils_Type::BIG,
182 'table_name' => 'civicrm_dedupe_rule_group',
183 'entity' => 'RuleGroup',
184 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
185 'localizable' => 0,
186 ) ,
187 'title' => array(
188 'name' => 'title',
189 'type' => CRM_Utils_Type::T_STRING,
190 'title' => ts('Title') ,
191 'description' => 'Label of the rule group',
192 'maxlength' => 255,
193 'size' => CRM_Utils_Type::HUGE,
194 'table_name' => 'civicrm_dedupe_rule_group',
195 'entity' => 'RuleGroup',
196 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
197 'localizable' => 0,
198 'html' => array(
199 'type' => 'Text',
200 ) ,
201 ) ,
202 'is_reserved' => array(
203 'name' => 'is_reserved',
204 'type' => CRM_Utils_Type::T_BOOLEAN,
205 'title' => ts('Reserved?') ,
206 'description' => 'Is this a reserved rule - a rule group that has been optimized and cannot be changed by the admin',
207 'table_name' => 'civicrm_dedupe_rule_group',
208 'entity' => 'RuleGroup',
209 'bao' => 'CRM_Dedupe_BAO_RuleGroup',
210 'localizable' => 0,
211 'html' => array(
212 'type' => 'CheckBox',
213 ) ,
214 ) ,
215 );
216 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
217 }
218 return Civi::$statics[__CLASS__]['fields'];
219 }
220 /**
221 * Return a mapping from field-name to the corresponding key (as used in fields()).
222 *
223 * @return array
224 * Array(string $name => string $uniqueName).
225 */
226 static function &fieldKeys() {
227 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
228 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
229 }
230 return Civi::$statics[__CLASS__]['fieldKeys'];
231 }
232 /**
233 * Returns the names of this table
234 *
235 * @return string
236 */
237 static function getTableName() {
238 return self::$_tableName;
239 }
240 /**
241 * Returns if this table needs to be logged
242 *
243 * @return boolean
244 */
245 function getLog() {
246 return self::$_log;
247 }
248 /**
249 * Returns the list of fields that can be imported
250 *
251 * @param bool $prefix
252 *
253 * @return array
254 */
255 static function &import($prefix = false) {
256 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'dedupe_rule_group', $prefix, array());
257 return $r;
258 }
259 /**
260 * Returns the list of fields that can be exported
261 *
262 * @param bool $prefix
263 *
264 * @return array
265 */
266 static function &export($prefix = false) {
267 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'dedupe_rule_group', $prefix, array());
268 return $r;
269 }
270 /**
271 * Returns the list of indices
272 */
273 public static function indices($localize = TRUE) {
274 $indices = array();
275 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
276 }
277 }