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