API/DAO Metadata - Retain versioning metadata for possible usage in runtime+tooling
[civicrm-core.git] / CRM / Core / DAO / UFGroup.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Core/UFGroup.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:acf9d6ef6307d473c8a32775aa8e8e66)
10 */
11
12 /**
13 * Database access object for the UFGroup entity.
14 */
15 class CRM_Core_DAO_UFGroup extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_uf_group';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 public static $_log = TRUE;
30
31 /**
32 * Unique table ID
33 *
34 * @var int
35 */
36 public $id;
37
38 /**
39 * Is this form currently active? If false, hide all related fields for all sharing contexts.
40 *
41 * @var bool
42 */
43 public $is_active;
44
45 /**
46 * Comma separated list of the type(s) of profile fields.
47 *
48 * @var string
49 */
50 public $group_type;
51
52 /**
53 * Form title.
54 *
55 * @var string
56 */
57 public $title;
58
59 /**
60 * Profile Form Public title
61 *
62 * @var string
63 */
64 public $frontend_title;
65
66 /**
67 * Optional verbose description of the profile.
68 *
69 * @var text
70 */
71 public $description;
72
73 /**
74 * Description and/or help text to display before fields in form.
75 *
76 * @var text
77 */
78 public $help_pre;
79
80 /**
81 * Description and/or help text to display after fields in form.
82 *
83 * @var text
84 */
85 public $help_post;
86
87 /**
88 * Group id, foreign key from civicrm_group
89 *
90 * @var int
91 */
92 public $limit_listings_group_id;
93
94 /**
95 * Redirect to URL.
96 *
97 * @var string
98 */
99 public $post_URL;
100
101 /**
102 * foreign key to civicrm_group_id
103 *
104 * @var int
105 */
106 public $add_to_group_id;
107
108 /**
109 * Should a CAPTCHA widget be included this Profile form.
110 *
111 * @var bool
112 */
113 public $add_captcha;
114
115 /**
116 * Do we want to map results from this profile.
117 *
118 * @var bool
119 */
120 public $is_map;
121
122 /**
123 * Should edit link display in profile selector
124 *
125 * @var bool
126 */
127 public $is_edit_link;
128
129 /**
130 * Should we display a link to the website profile in profile selector
131 *
132 * @var bool
133 */
134 public $is_uf_link;
135
136 /**
137 * Should we update the contact record if we find a duplicate
138 *
139 * @var bool
140 */
141 public $is_update_dupe;
142
143 /**
144 * Redirect to URL when Cancle button clik .
145 *
146 * @var string
147 */
148 public $cancel_URL;
149
150 /**
151 * Should we create a cms user for this profile
152 *
153 * @var bool
154 */
155 public $is_cms_user;
156
157 /**
158 * @var text
159 */
160 public $notify;
161
162 /**
163 * Is this group reserved for use by some other CiviCRM functionality?
164 *
165 * @var bool
166 */
167 public $is_reserved;
168
169 /**
170 * Name of the UF group for directly addressing it in the codebase
171 *
172 * @var string
173 */
174 public $name;
175
176 /**
177 * FK to civicrm_contact, who created this UF group
178 *
179 * @var int
180 */
181 public $created_id;
182
183 /**
184 * Date and time this UF group was created.
185 *
186 * @var datetime
187 */
188 public $created_date;
189
190 /**
191 * Should we include proximity search feature in this profile search form?
192 *
193 * @var bool
194 */
195 public $is_proximity_search;
196
197 /**
198 * Custom Text to display on the Cancel button when used in create or edit mode
199 *
200 * @var string
201 */
202 public $cancel_button_text;
203
204 /**
205 * Custom Text to display on the submit button on profile edit/create screens
206 *
207 * @var string
208 */
209 public $submit_button_text;
210
211 /**
212 * Should a Cancel button be included in this Profile form.
213 *
214 * @var bool
215 */
216 public $add_cancel_button;
217
218 /**
219 * Class constructor.
220 */
221 public function __construct() {
222 $this->__table = 'civicrm_uf_group';
223 parent::__construct();
224 }
225
226 /**
227 * Returns localized title of this entity.
228 */
229 public static function getEntityTitle() {
230 return ts('UFGroups');
231 }
232
233 /**
234 * Returns foreign keys and entity references.
235 *
236 * @return array
237 * [CRM_Core_Reference_Interface]
238 */
239 public static function getReferenceColumns() {
240 if (!isset(Civi::$statics[__CLASS__]['links'])) {
241 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
242 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'limit_listings_group_id', 'civicrm_group', 'id');
243 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'add_to_group_id', 'civicrm_group', 'id');
244 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'created_id', 'civicrm_contact', 'id');
245 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
246 }
247 return Civi::$statics[__CLASS__]['links'];
248 }
249
250 /**
251 * Returns all the column names of this table
252 *
253 * @return array
254 */
255 public static function &fields() {
256 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
257 Civi::$statics[__CLASS__]['fields'] = [
258 'id' => [
259 'name' => 'id',
260 'type' => CRM_Utils_Type::T_INT,
261 'title' => ts('Profile ID'),
262 'description' => ts('Unique table ID'),
263 'required' => TRUE,
264 'where' => 'civicrm_uf_group.id',
265 'table_name' => 'civicrm_uf_group',
266 'entity' => 'UFGroup',
267 'bao' => 'CRM_Core_BAO_UFGroup',
268 'localizable' => 0,
269 'add' => '1.1',
270 ],
271 'is_active' => [
272 'name' => 'is_active',
273 'type' => CRM_Utils_Type::T_BOOLEAN,
274 'title' => ts('Profile Is Active'),
275 'description' => ts('Is this form currently active? If false, hide all related fields for all sharing contexts.'),
276 'where' => 'civicrm_uf_group.is_active',
277 'default' => '1',
278 'table_name' => 'civicrm_uf_group',
279 'entity' => 'UFGroup',
280 'bao' => 'CRM_Core_BAO_UFGroup',
281 'localizable' => 0,
282 'add' => '1.1',
283 ],
284 'group_type' => [
285 'name' => 'group_type',
286 'type' => CRM_Utils_Type::T_STRING,
287 'title' => ts('Profile Group Type'),
288 'description' => ts('Comma separated list of the type(s) of profile fields.'),
289 'maxlength' => 255,
290 'size' => CRM_Utils_Type::HUGE,
291 'import' => TRUE,
292 'where' => 'civicrm_uf_group.group_type',
293 'export' => TRUE,
294 'table_name' => 'civicrm_uf_group',
295 'entity' => 'UFGroup',
296 'bao' => 'CRM_Core_BAO_UFGroup',
297 'localizable' => 0,
298 'serialize' => self::SERIALIZE_COMMA,
299 'add' => '2.1',
300 ],
301 'title' => [
302 'name' => 'title',
303 'type' => CRM_Utils_Type::T_STRING,
304 'title' => ts('Profile Name'),
305 'description' => ts('Form title.'),
306 'required' => TRUE,
307 'maxlength' => 64,
308 'size' => CRM_Utils_Type::BIG,
309 'where' => 'civicrm_uf_group.title',
310 'table_name' => 'civicrm_uf_group',
311 'entity' => 'UFGroup',
312 'bao' => 'CRM_Core_BAO_UFGroup',
313 'localizable' => 1,
314 'html' => [
315 'type' => 'Text',
316 ],
317 'add' => '1.1',
318 ],
319 'frontend_title' => [
320 'name' => 'frontend_title',
321 'type' => CRM_Utils_Type::T_STRING,
322 'title' => ts('Public Title'),
323 'description' => ts('Profile Form Public title'),
324 'maxlength' => 64,
325 'size' => CRM_Utils_Type::BIG,
326 'where' => 'civicrm_uf_group.frontend_title',
327 'table_name' => 'civicrm_uf_group',
328 'entity' => 'UFGroup',
329 'bao' => 'CRM_Core_BAO_UFGroup',
330 'localizable' => 1,
331 'html' => [
332 'type' => 'Text',
333 ],
334 'add' => '4.7',
335 ],
336 'description' => [
337 'name' => 'description',
338 'type' => CRM_Utils_Type::T_TEXT,
339 'title' => ts('Profile Description'),
340 'description' => ts('Optional verbose description of the profile.'),
341 'rows' => 2,
342 'cols' => 60,
343 'where' => 'civicrm_uf_group.description',
344 'table_name' => 'civicrm_uf_group',
345 'entity' => 'UFGroup',
346 'bao' => 'CRM_Core_BAO_UFGroup',
347 'localizable' => 0,
348 'html' => [
349 'type' => 'TextArea',
350 ],
351 'add' => '4.4',
352 ],
353 'help_pre' => [
354 'name' => 'help_pre',
355 'type' => CRM_Utils_Type::T_TEXT,
356 'title' => ts('Help Pre'),
357 'description' => ts('Description and/or help text to display before fields in form.'),
358 'rows' => 4,
359 'cols' => 80,
360 'where' => 'civicrm_uf_group.help_pre',
361 'table_name' => 'civicrm_uf_group',
362 'entity' => 'UFGroup',
363 'bao' => 'CRM_Core_BAO_UFGroup',
364 'localizable' => 1,
365 'html' => [
366 'type' => 'TextArea',
367 ],
368 'add' => '1.2',
369 ],
370 'help_post' => [
371 'name' => 'help_post',
372 'type' => CRM_Utils_Type::T_TEXT,
373 'title' => ts('Profile Post Text'),
374 'description' => ts('Description and/or help text to display after fields in form.'),
375 'rows' => 4,
376 'cols' => 80,
377 'where' => 'civicrm_uf_group.help_post',
378 'table_name' => 'civicrm_uf_group',
379 'entity' => 'UFGroup',
380 'bao' => 'CRM_Core_BAO_UFGroup',
381 'localizable' => 1,
382 'html' => [
383 'type' => 'TextArea',
384 ],
385 'add' => '1.2',
386 ],
387 'limit_listings_group_id' => [
388 'name' => 'limit_listings_group_id',
389 'type' => CRM_Utils_Type::T_INT,
390 'title' => ts('Profile Search Limit Group'),
391 'description' => ts('Group id, foreign key from civicrm_group'),
392 'where' => 'civicrm_uf_group.limit_listings_group_id',
393 'table_name' => 'civicrm_uf_group',
394 'entity' => 'UFGroup',
395 'bao' => 'CRM_Core_BAO_UFGroup',
396 'localizable' => 0,
397 'FKClassName' => 'CRM_Contact_DAO_Group',
398 'add' => '1.4',
399 ],
400 'post_URL' => [
401 'name' => 'post_URL',
402 'type' => CRM_Utils_Type::T_STRING,
403 'title' => ts('Post Url'),
404 'description' => ts('Redirect to URL.'),
405 'maxlength' => 255,
406 'size' => CRM_Utils_Type::HUGE,
407 'where' => 'civicrm_uf_group.post_URL',
408 'table_name' => 'civicrm_uf_group',
409 'entity' => 'UFGroup',
410 'bao' => 'CRM_Core_BAO_UFGroup',
411 'localizable' => 0,
412 'add' => '1.4',
413 ],
414 'add_to_group_id' => [
415 'name' => 'add_to_group_id',
416 'type' => CRM_Utils_Type::T_INT,
417 'title' => ts('Add Contact To Group'),
418 'description' => ts('foreign key to civicrm_group_id'),
419 'where' => 'civicrm_uf_group.add_to_group_id',
420 'table_name' => 'civicrm_uf_group',
421 'entity' => 'UFGroup',
422 'bao' => 'CRM_Core_BAO_UFGroup',
423 'localizable' => 0,
424 'FKClassName' => 'CRM_Contact_DAO_Group',
425 'add' => NULL,
426 ],
427 'add_captcha' => [
428 'name' => 'add_captcha',
429 'type' => CRM_Utils_Type::T_BOOLEAN,
430 'title' => ts('Show Captcha On Profile'),
431 'description' => ts('Should a CAPTCHA widget be included this Profile form.'),
432 'where' => 'civicrm_uf_group.add_captcha',
433 'default' => '0',
434 'table_name' => 'civicrm_uf_group',
435 'entity' => 'UFGroup',
436 'bao' => 'CRM_Core_BAO_UFGroup',
437 'localizable' => 0,
438 'add' => '1.1',
439 ],
440 'is_map' => [
441 'name' => 'is_map',
442 'type' => CRM_Utils_Type::T_BOOLEAN,
443 'title' => ts('Map Profile'),
444 'description' => ts('Do we want to map results from this profile.'),
445 'where' => 'civicrm_uf_group.is_map',
446 'default' => '0',
447 'table_name' => 'civicrm_uf_group',
448 'entity' => 'UFGroup',
449 'bao' => 'CRM_Core_BAO_UFGroup',
450 'localizable' => 0,
451 'add' => '1.5',
452 ],
453 'is_edit_link' => [
454 'name' => 'is_edit_link',
455 'type' => CRM_Utils_Type::T_BOOLEAN,
456 'title' => ts('Show Edit Link?'),
457 'description' => ts('Should edit link display in profile selector'),
458 'where' => 'civicrm_uf_group.is_edit_link',
459 'default' => '0',
460 'table_name' => 'civicrm_uf_group',
461 'entity' => 'UFGroup',
462 'bao' => 'CRM_Core_BAO_UFGroup',
463 'localizable' => 0,
464 'add' => '1.6',
465 ],
466 'is_uf_link' => [
467 'name' => 'is_uf_link',
468 'type' => CRM_Utils_Type::T_BOOLEAN,
469 'title' => ts('Show Link to CMS User'),
470 'description' => ts('Should we display a link to the website profile in profile selector'),
471 'where' => 'civicrm_uf_group.is_uf_link',
472 'default' => '0',
473 'table_name' => 'civicrm_uf_group',
474 'entity' => 'UFGroup',
475 'bao' => 'CRM_Core_BAO_UFGroup',
476 'localizable' => 0,
477 'add' => '1.7',
478 ],
479 'is_update_dupe' => [
480 'name' => 'is_update_dupe',
481 'type' => CRM_Utils_Type::T_BOOLEAN,
482 'title' => ts('Update on Duplicate'),
483 'description' => ts('Should we update the contact record if we find a duplicate'),
484 'where' => 'civicrm_uf_group.is_update_dupe',
485 'default' => '0',
486 'table_name' => 'civicrm_uf_group',
487 'entity' => 'UFGroup',
488 'bao' => 'CRM_Core_BAO_UFGroup',
489 'localizable' => 0,
490 'add' => '1.7',
491 ],
492 'cancel_URL' => [
493 'name' => 'cancel_URL',
494 'type' => CRM_Utils_Type::T_STRING,
495 'title' => ts('Profile Cancel URL'),
496 'description' => ts('Redirect to URL when Cancle button clik .'),
497 'maxlength' => 255,
498 'size' => CRM_Utils_Type::HUGE,
499 'where' => 'civicrm_uf_group.cancel_URL',
500 'table_name' => 'civicrm_uf_group',
501 'entity' => 'UFGroup',
502 'bao' => 'CRM_Core_BAO_UFGroup',
503 'localizable' => 0,
504 'add' => '1.4',
505 ],
506 'is_cms_user' => [
507 'name' => 'is_cms_user',
508 'type' => CRM_Utils_Type::T_BOOLEAN,
509 'title' => ts('Create CMS User?'),
510 'description' => ts('Should we create a cms user for this profile '),
511 'where' => 'civicrm_uf_group.is_cms_user',
512 'default' => '0',
513 'table_name' => 'civicrm_uf_group',
514 'entity' => 'UFGroup',
515 'bao' => 'CRM_Core_BAO_UFGroup',
516 'localizable' => 0,
517 'add' => '1.8',
518 ],
519 'notify' => [
520 'name' => 'notify',
521 'type' => CRM_Utils_Type::T_TEXT,
522 'title' => ts('Notify on Profile Submit'),
523 'where' => 'civicrm_uf_group.notify',
524 'table_name' => 'civicrm_uf_group',
525 'entity' => 'UFGroup',
526 'bao' => 'CRM_Core_BAO_UFGroup',
527 'localizable' => 0,
528 'add' => '1.8',
529 ],
530 'is_reserved' => [
531 'name' => 'is_reserved',
532 'type' => CRM_Utils_Type::T_BOOLEAN,
533 'title' => ts('Profile Is Reserved'),
534 'description' => ts('Is this group reserved for use by some other CiviCRM functionality?'),
535 'where' => 'civicrm_uf_group.is_reserved',
536 'table_name' => 'civicrm_uf_group',
537 'entity' => 'UFGroup',
538 'bao' => 'CRM_Core_BAO_UFGroup',
539 'localizable' => 0,
540 'add' => '3.0',
541 ],
542 'name' => [
543 'name' => 'name',
544 'type' => CRM_Utils_Type::T_STRING,
545 'title' => ts('Profile Name'),
546 'description' => ts('Name of the UF group for directly addressing it in the codebase'),
547 'maxlength' => 64,
548 'size' => CRM_Utils_Type::BIG,
549 'where' => 'civicrm_uf_group.name',
550 'table_name' => 'civicrm_uf_group',
551 'entity' => 'UFGroup',
552 'bao' => 'CRM_Core_BAO_UFGroup',
553 'localizable' => 0,
554 'add' => '3.0',
555 ],
556 'created_id' => [
557 'name' => 'created_id',
558 'type' => CRM_Utils_Type::T_INT,
559 'title' => ts('Profile Created By'),
560 'description' => ts('FK to civicrm_contact, who created this UF group'),
561 'where' => 'civicrm_uf_group.created_id',
562 'table_name' => 'civicrm_uf_group',
563 'entity' => 'UFGroup',
564 'bao' => 'CRM_Core_BAO_UFGroup',
565 'localizable' => 0,
566 'FKClassName' => 'CRM_Contact_DAO_Contact',
567 'add' => '3.0',
568 ],
569 'created_date' => [
570 'name' => 'created_date',
571 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
572 'title' => ts('UF Group Created Date'),
573 'description' => ts('Date and time this UF group was created.'),
574 'where' => 'civicrm_uf_group.created_date',
575 'table_name' => 'civicrm_uf_group',
576 'entity' => 'UFGroup',
577 'bao' => 'CRM_Core_BAO_UFGroup',
578 'localizable' => 0,
579 'add' => '3.0',
580 ],
581 'is_proximity_search' => [
582 'name' => 'is_proximity_search',
583 'type' => CRM_Utils_Type::T_BOOLEAN,
584 'title' => ts('Include Proximity Search?'),
585 'description' => ts('Should we include proximity search feature in this profile search form?'),
586 'where' => 'civicrm_uf_group.is_proximity_search',
587 'default' => '0',
588 'table_name' => 'civicrm_uf_group',
589 'entity' => 'UFGroup',
590 'bao' => 'CRM_Core_BAO_UFGroup',
591 'localizable' => 0,
592 'add' => '3.2',
593 ],
594 'cancel_button_text' => [
595 'name' => 'cancel_button_text',
596 'type' => CRM_Utils_Type::T_STRING,
597 'title' => ts('Cancel Button Text'),
598 'description' => ts('Custom Text to display on the Cancel button when used in create or edit mode'),
599 'maxlength' => 64,
600 'size' => CRM_Utils_Type::BIG,
601 'where' => 'civicrm_uf_group.cancel_button_text',
602 'default' => 'NULL',
603 'table_name' => 'civicrm_uf_group',
604 'entity' => 'UFGroup',
605 'bao' => 'CRM_Core_BAO_UFGroup',
606 'localizable' => 1,
607 'html' => [
608 'type' => 'Text',
609 ],
610 'add' => '4.7',
611 ],
612 'submit_button_text' => [
613 'name' => 'submit_button_text',
614 'type' => CRM_Utils_Type::T_STRING,
615 'title' => ts('Submit Button Text'),
616 'description' => ts('Custom Text to display on the submit button on profile edit/create screens'),
617 'maxlength' => 64,
618 'size' => CRM_Utils_Type::BIG,
619 'where' => 'civicrm_uf_group.submit_button_text',
620 'default' => 'NULL',
621 'table_name' => 'civicrm_uf_group',
622 'entity' => 'UFGroup',
623 'bao' => 'CRM_Core_BAO_UFGroup',
624 'localizable' => 1,
625 'html' => [
626 'type' => 'Text',
627 ],
628 'add' => '4.7',
629 ],
630 'add_cancel_button' => [
631 'name' => 'add_cancel_button',
632 'type' => CRM_Utils_Type::T_BOOLEAN,
633 'title' => ts('Include Cancel Button'),
634 'description' => ts('Should a Cancel button be included in this Profile form.'),
635 'where' => 'civicrm_uf_group.add_cancel_button',
636 'default' => '1',
637 'table_name' => 'civicrm_uf_group',
638 'entity' => 'UFGroup',
639 'bao' => 'CRM_Core_BAO_UFGroup',
640 'localizable' => 0,
641 'add' => '5.0',
642 ],
643 ];
644 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
645 }
646 return Civi::$statics[__CLASS__]['fields'];
647 }
648
649 /**
650 * Return a mapping from field-name to the corresponding key (as used in fields()).
651 *
652 * @return array
653 * Array(string $name => string $uniqueName).
654 */
655 public static function &fieldKeys() {
656 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
657 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
658 }
659 return Civi::$statics[__CLASS__]['fieldKeys'];
660 }
661
662 /**
663 * Returns the names of this table
664 *
665 * @return string
666 */
667 public static function getTableName() {
668 return CRM_Core_DAO::getLocaleTableName(self::$_tableName);
669 }
670
671 /**
672 * Returns if this table needs to be logged
673 *
674 * @return bool
675 */
676 public function getLog() {
677 return self::$_log;
678 }
679
680 /**
681 * Returns the list of fields that can be imported
682 *
683 * @param bool $prefix
684 *
685 * @return array
686 */
687 public static function &import($prefix = FALSE) {
688 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'uf_group', $prefix, []);
689 return $r;
690 }
691
692 /**
693 * Returns the list of fields that can be exported
694 *
695 * @param bool $prefix
696 *
697 * @return array
698 */
699 public static function &export($prefix = FALSE) {
700 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'uf_group', $prefix, []);
701 return $r;
702 }
703
704 /**
705 * Returns the list of indices
706 *
707 * @param bool $localize
708 *
709 * @return array
710 */
711 public static function indices($localize = TRUE) {
712 $indices = [
713 'UI_name' => [
714 'name' => 'UI_name',
715 'field' => [
716 0 => 'name',
717 ],
718 'localizable' => FALSE,
719 'unique' => TRUE,
720 'sig' => 'civicrm_uf_group::1::name',
721 ],
722 ];
723 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
724 }
725
726 }