CRM-20312 regenerated DAO with localisation
[civicrm-core.git] / CRM / Core / DAO / CustomGroup.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/Core/CustomGroup.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:9b3c453f7ada933490dc68bc2b45e77b)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 /**
38 * CRM_Core_DAO_CustomGroup constructor.
39 */
40 class CRM_Core_DAO_CustomGroup extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_custom_group';
47 /**
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
49 *
50 * @var boolean
51 */
52 static $_log = true;
53 /**
54 * Unique Custom Group ID
55 *
56 * @var int unsigned
57 */
58 public $id;
59 /**
60 * Variable name/programmatic handle for this group.
61 *
62 * @var string
63 */
64 public $name;
65 /**
66 * Friendly Name.
67 *
68 * @var string
69 */
70 public $title;
71 /**
72 * Type of object this group extends (can add other options later e.g. contact_address, etc.).
73 *
74 * @var string
75 */
76 public $extends;
77 /**
78 * FK to civicrm_option_value.id (for option group custom_data_type.)
79 *
80 * @var int unsigned
81 */
82 public $extends_entity_column_id;
83 /**
84 * linking custom group for dynamic object
85 *
86 * @var string
87 */
88 public $extends_entity_column_value;
89 /**
90 * Visual relationship between this form and its parent.
91 *
92 * @var string
93 */
94 public $style;
95 /**
96 * Will this group be in collapsed or expanded mode on initial display ?
97 *
98 * @var int unsigned
99 */
100 public $collapse_display;
101 /**
102 * Description and/or help text to display before fields in form.
103 *
104 * @var text
105 */
106 public $help_pre;
107 /**
108 * Description and/or help text to display after fields in form.
109 *
110 * @var text
111 */
112 public $help_post;
113 /**
114 * Controls display order when multiple extended property groups are setup for the same class.
115 *
116 * @var int
117 */
118 public $weight;
119 /**
120 * Is this property active?
121 *
122 * @var boolean
123 */
124 public $is_active;
125 /**
126 * Name of the table that holds the values for this group.
127 *
128 * @var string
129 */
130 public $table_name;
131 /**
132 * Does this group hold multiple values?
133 *
134 * @var boolean
135 */
136 public $is_multiple;
137 /**
138 * minimum number of multiple records (typically 0?)
139 *
140 * @var int unsigned
141 */
142 public $min_multiple;
143 /**
144 * maximum number of multiple records, if 0 - no max
145 *
146 * @var int unsigned
147 */
148 public $max_multiple;
149 /**
150 * Will this group be in collapsed or expanded mode on advanced search display ?
151 *
152 * @var int unsigned
153 */
154 public $collapse_adv_display;
155 /**
156 * FK to civicrm_contact, who created this custom group
157 *
158 * @var int unsigned
159 */
160 public $created_id;
161 /**
162 * Date and time this custom group was created.
163 *
164 * @var datetime
165 */
166 public $created_date;
167 /**
168 * Is this a reserved Custom Group?
169 *
170 * @var boolean
171 */
172 public $is_reserved;
173 /**
174 * Class constructor.
175 */
176 function __construct() {
177 $this->__table = 'civicrm_custom_group';
178 parent::__construct();
179 }
180 /**
181 * Returns foreign keys and entity references.
182 *
183 * @return array
184 * [CRM_Core_Reference_Interface]
185 */
186 static function getReferenceColumns() {
187 if (!isset(Civi::$statics[__CLASS__]['links'])) {
188 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
189 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'created_id', 'civicrm_contact', 'id');
190 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
191 }
192 return Civi::$statics[__CLASS__]['links'];
193 }
194 /**
195 * Returns all the column names of this table
196 *
197 * @return array
198 */
199 static function &fields() {
200 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
201 Civi::$statics[__CLASS__]['fields'] = array(
202 'id' => array(
203 'name' => 'id',
204 'type' => CRM_Utils_Type::T_INT,
205 'title' => ts('Custom Group ID') ,
206 'description' => 'Unique Custom Group ID',
207 'required' => true,
208 'table_name' => 'civicrm_custom_group',
209 'entity' => 'CustomGroup',
210 'bao' => 'CRM_Core_BAO_CustomGroup',
211 'localizable' => 0,
212 ) ,
213 'name' => array(
214 'name' => 'name',
215 'type' => CRM_Utils_Type::T_STRING,
216 'title' => ts('Custom Group Name') ,
217 'description' => 'Variable name/programmatic handle for this group.',
218 'maxlength' => 64,
219 'size' => CRM_Utils_Type::BIG,
220 'table_name' => 'civicrm_custom_group',
221 'entity' => 'CustomGroup',
222 'bao' => 'CRM_Core_BAO_CustomGroup',
223 'localizable' => 0,
224 ) ,
225 'title' => array(
226 'name' => 'title',
227 'type' => CRM_Utils_Type::T_STRING,
228 'title' => ts('Custom Group Title') ,
229 'description' => 'Friendly Name.',
230 'required' => true,
231 'maxlength' => 64,
232 'size' => CRM_Utils_Type::BIG,
233 'table_name' => 'civicrm_custom_group',
234 'entity' => 'CustomGroup',
235 'bao' => 'CRM_Core_BAO_CustomGroup',
236 'localizable' => 1,
237 ) ,
238 'extends' => array(
239 'name' => 'extends',
240 'type' => CRM_Utils_Type::T_STRING,
241 'title' => ts('Custom Group Extends') ,
242 'description' => 'Type of object this group extends (can add other options later e.g. contact_address, etc.).',
243 'maxlength' => 255,
244 'size' => CRM_Utils_Type::HUGE,
245 'default' => 'Contact',
246 'table_name' => 'civicrm_custom_group',
247 'entity' => 'CustomGroup',
248 'bao' => 'CRM_Core_BAO_CustomGroup',
249 'localizable' => 0,
250 ) ,
251 'extends_entity_column_id' => array(
252 'name' => 'extends_entity_column_id',
253 'type' => CRM_Utils_Type::T_INT,
254 'title' => ts('Custom Group Subtype List') ,
255 'description' => 'FK to civicrm_option_value.id (for option group custom_data_type.)',
256 'default' => 'NULL',
257 'table_name' => 'civicrm_custom_group',
258 'entity' => 'CustomGroup',
259 'bao' => 'CRM_Core_BAO_CustomGroup',
260 'localizable' => 0,
261 ) ,
262 'extends_entity_column_value' => array(
263 'name' => 'extends_entity_column_value',
264 'type' => CRM_Utils_Type::T_STRING,
265 'title' => ts('Custom Group Subtype') ,
266 'description' => 'linking custom group for dynamic object',
267 'maxlength' => 255,
268 'size' => CRM_Utils_Type::HUGE,
269 'table_name' => 'civicrm_custom_group',
270 'entity' => 'CustomGroup',
271 'bao' => 'CRM_Core_BAO_CustomGroup',
272 'localizable' => 0,
273 ) ,
274 'style' => array(
275 'name' => 'style',
276 'type' => CRM_Utils_Type::T_STRING,
277 'title' => ts('Custom Group Style') ,
278 'description' => 'Visual relationship between this form and its parent.',
279 'maxlength' => 15,
280 'size' => CRM_Utils_Type::TWELVE,
281 'table_name' => 'civicrm_custom_group',
282 'entity' => 'CustomGroup',
283 'bao' => 'CRM_Core_BAO_CustomGroup',
284 'localizable' => 0,
285 'html' => array(
286 'type' => 'Select',
287 ) ,
288 'pseudoconstant' => array(
289 'callback' => 'CRM_Core_SelectValues::customGroupStyle',
290 )
291 ) ,
292 'collapse_display' => array(
293 'name' => 'collapse_display',
294 'type' => CRM_Utils_Type::T_INT,
295 'title' => ts('Collapse Custom Group?') ,
296 'description' => 'Will this group be in collapsed or expanded mode on initial display ?',
297 'table_name' => 'civicrm_custom_group',
298 'entity' => 'CustomGroup',
299 'bao' => 'CRM_Core_BAO_CustomGroup',
300 'localizable' => 0,
301 ) ,
302 'help_pre' => array(
303 'name' => 'help_pre',
304 'type' => CRM_Utils_Type::T_TEXT,
305 'title' => ts('Custom Group Pre Text') ,
306 'description' => 'Description and/or help text to display before fields in form.',
307 'rows' => 4,
308 'cols' => 80,
309 'table_name' => 'civicrm_custom_group',
310 'entity' => 'CustomGroup',
311 'bao' => 'CRM_Core_BAO_CustomGroup',
312 'localizable' => 1,
313 'html' => array(
314 'type' => 'TextArea',
315 ) ,
316 ) ,
317 'help_post' => array(
318 'name' => 'help_post',
319 'type' => CRM_Utils_Type::T_TEXT,
320 'title' => ts('Custom Group Post Text') ,
321 'description' => 'Description and/or help text to display after fields in form.',
322 'rows' => 4,
323 'cols' => 80,
324 'table_name' => 'civicrm_custom_group',
325 'entity' => 'CustomGroup',
326 'bao' => 'CRM_Core_BAO_CustomGroup',
327 'localizable' => 1,
328 'html' => array(
329 'type' => 'TextArea',
330 ) ,
331 ) ,
332 'weight' => array(
333 'name' => 'weight',
334 'type' => CRM_Utils_Type::T_INT,
335 'title' => ts('Order') ,
336 'description' => 'Controls display order when multiple extended property groups are setup for the same class.',
337 'required' => true,
338 'default' => '1',
339 'table_name' => 'civicrm_custom_group',
340 'entity' => 'CustomGroup',
341 'bao' => 'CRM_Core_BAO_CustomGroup',
342 'localizable' => 0,
343 ) ,
344 'is_active' => array(
345 'name' => 'is_active',
346 'type' => CRM_Utils_Type::T_BOOLEAN,
347 'title' => ts('Custom Group Is Active?') ,
348 'description' => 'Is this property active?',
349 'table_name' => 'civicrm_custom_group',
350 'entity' => 'CustomGroup',
351 'bao' => 'CRM_Core_BAO_CustomGroup',
352 'localizable' => 0,
353 ) ,
354 'table_name' => array(
355 'name' => 'table_name',
356 'type' => CRM_Utils_Type::T_STRING,
357 'title' => ts('Table Name') ,
358 'description' => 'Name of the table that holds the values for this group.',
359 'maxlength' => 255,
360 'size' => CRM_Utils_Type::HUGE,
361 'table_name' => 'civicrm_custom_group',
362 'entity' => 'CustomGroup',
363 'bao' => 'CRM_Core_BAO_CustomGroup',
364 'localizable' => 0,
365 ) ,
366 'is_multiple' => array(
367 'name' => 'is_multiple',
368 'type' => CRM_Utils_Type::T_BOOLEAN,
369 'title' => ts('Supports Multiple Records') ,
370 'description' => 'Does this group hold multiple values?',
371 'table_name' => 'civicrm_custom_group',
372 'entity' => 'CustomGroup',
373 'bao' => 'CRM_Core_BAO_CustomGroup',
374 'localizable' => 0,
375 ) ,
376 'min_multiple' => array(
377 'name' => 'min_multiple',
378 'type' => CRM_Utils_Type::T_INT,
379 'title' => ts('Minimum Multiple Records') ,
380 'description' => 'minimum number of multiple records (typically 0?)',
381 'table_name' => 'civicrm_custom_group',
382 'entity' => 'CustomGroup',
383 'bao' => 'CRM_Core_BAO_CustomGroup',
384 'localizable' => 0,
385 ) ,
386 'max_multiple' => array(
387 'name' => 'max_multiple',
388 'type' => CRM_Utils_Type::T_INT,
389 'title' => ts('Maximum Multiple Records') ,
390 'description' => 'maximum number of multiple records, if 0 - no max',
391 'table_name' => 'civicrm_custom_group',
392 'entity' => 'CustomGroup',
393 'bao' => 'CRM_Core_BAO_CustomGroup',
394 'localizable' => 0,
395 ) ,
396 'collapse_adv_display' => array(
397 'name' => 'collapse_adv_display',
398 'type' => CRM_Utils_Type::T_INT,
399 'title' => ts('Collapse Group Display') ,
400 'description' => 'Will this group be in collapsed or expanded mode on advanced search display ?',
401 'table_name' => 'civicrm_custom_group',
402 'entity' => 'CustomGroup',
403 'bao' => 'CRM_Core_BAO_CustomGroup',
404 'localizable' => 0,
405 ) ,
406 'created_id' => array(
407 'name' => 'created_id',
408 'type' => CRM_Utils_Type::T_INT,
409 'title' => ts('Custom Group Created By') ,
410 'description' => 'FK to civicrm_contact, who created this custom group',
411 'table_name' => 'civicrm_custom_group',
412 'entity' => 'CustomGroup',
413 'bao' => 'CRM_Core_BAO_CustomGroup',
414 'localizable' => 0,
415 'FKClassName' => 'CRM_Contact_DAO_Contact',
416 ) ,
417 'created_date' => array(
418 'name' => 'created_date',
419 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
420 'title' => ts('Custom Group Created Date') ,
421 'description' => 'Date and time this custom group was created.',
422 'table_name' => 'civicrm_custom_group',
423 'entity' => 'CustomGroup',
424 'bao' => 'CRM_Core_BAO_CustomGroup',
425 'localizable' => 0,
426 ) ,
427 'is_reserved' => array(
428 'name' => 'is_reserved',
429 'type' => CRM_Utils_Type::T_BOOLEAN,
430 'title' => ts('Reserved Group?') ,
431 'description' => 'Is this a reserved Custom Group?',
432 'table_name' => 'civicrm_custom_group',
433 'entity' => 'CustomGroup',
434 'bao' => 'CRM_Core_BAO_CustomGroup',
435 'localizable' => 0,
436 ) ,
437 );
438 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
439 }
440 return Civi::$statics[__CLASS__]['fields'];
441 }
442 /**
443 * Return a mapping from field-name to the corresponding key (as used in fields()).
444 *
445 * @return array
446 * Array(string $name => string $uniqueName).
447 */
448 static function &fieldKeys() {
449 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
450 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
451 }
452 return Civi::$statics[__CLASS__]['fieldKeys'];
453 }
454 /**
455 * Returns the names of this table
456 *
457 * @return string
458 */
459 static function getTableName() {
460 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
461 }
462 /**
463 * Returns if this table needs to be logged
464 *
465 * @return boolean
466 */
467 function getLog() {
468 return self::$_log;
469 }
470 /**
471 * Returns the list of fields that can be imported
472 *
473 * @param bool $prefix
474 *
475 * @return array
476 */
477 static function &import($prefix = false) {
478 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'custom_group', $prefix, array());
479 return $r;
480 }
481 /**
482 * Returns the list of fields that can be exported
483 *
484 * @param bool $prefix
485 *
486 * @return array
487 */
488 static function &export($prefix = false) {
489 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'custom_group', $prefix, array());
490 return $r;
491 }
492 }