5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/UFGroup.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:37e03f3367ced4a53471f4f137c8c8ad)
13 * Database access object for the UFGroup entity.
15 class CRM_Core_DAO_UFGroup
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '1.1';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_uf_group';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = TRUE;
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
43 * Is this form currently active? If false, hide all related fields for all sharing contexts.
47 * Note that values will be retrieved from the database as a string.
52 * Comma separated list of the type(s) of profile fields.
55 * (SQL type: varchar(255))
56 * Note that values will be retrieved from the database as a string.
64 * (SQL type: varchar(64))
65 * Note that values will be retrieved from the database as a string.
70 * Profile Form Public title
73 * (SQL type: varchar(64))
74 * Note that values will be retrieved from the database as a string.
76 public $frontend_title;
79 * Optional verbose description of the profile.
83 * Note that values will be retrieved from the database as a string.
88 * Description and/or help text to display before fields in form.
92 * Note that values will be retrieved from the database as a string.
97 * Description and/or help text to display after fields in form.
101 * Note that values will be retrieved from the database as a string.
106 * Group id, foreign key from civicrm_group
108 * @var int|string|null
109 * (SQL type: int unsigned)
110 * Note that values will be retrieved from the database as a string.
112 public $limit_listings_group_id;
118 * (SQL type: varchar(255))
119 * Note that values will be retrieved from the database as a string.
124 * foreign key to civicrm_group_id
126 * @var int|string|null
127 * (SQL type: int unsigned)
128 * Note that values will be retrieved from the database as a string.
130 public $add_to_group_id;
133 * Should a CAPTCHA widget be included this Profile form.
136 * (SQL type: tinyint)
137 * Note that values will be retrieved from the database as a string.
142 * Do we want to map results from this profile.
145 * (SQL type: tinyint)
146 * Note that values will be retrieved from the database as a string.
151 * Should edit link display in profile selector
154 * (SQL type: tinyint)
155 * Note that values will be retrieved from the database as a string.
157 public $is_edit_link;
160 * Should we display a link to the website profile in profile selector
163 * (SQL type: tinyint)
164 * Note that values will be retrieved from the database as a string.
169 * Should we update the contact record if we find a duplicate
172 * (SQL type: tinyint)
173 * Note that values will be retrieved from the database as a string.
175 public $is_update_dupe;
178 * Redirect to URL when Cancle button clik .
181 * (SQL type: varchar(255))
182 * Note that values will be retrieved from the database as a string.
187 * Should we create a cms user for this profile
190 * (SQL type: tinyint)
191 * Note that values will be retrieved from the database as a string.
198 * Note that values will be retrieved from the database as a string.
203 * Is this group reserved for use by some other CiviCRM functionality?
206 * (SQL type: tinyint)
207 * Note that values will be retrieved from the database as a string.
212 * Name of the UF group for directly addressing it in the codebase
215 * (SQL type: varchar(64))
216 * Note that values will be retrieved from the database as a string.
221 * FK to civicrm_contact, who created this UF group
223 * @var int|string|null
224 * (SQL type: int unsigned)
225 * Note that values will be retrieved from the database as a string.
230 * Date and time this UF group was created.
233 * (SQL type: datetime)
234 * Note that values will be retrieved from the database as a string.
236 public $created_date;
239 * Should we include proximity search feature in this profile search form?
242 * (SQL type: tinyint)
243 * Note that values will be retrieved from the database as a string.
245 public $is_proximity_search;
248 * Custom Text to display on the Cancel button when used in create or edit mode
251 * (SQL type: varchar(64))
252 * Note that values will be retrieved from the database as a string.
254 public $cancel_button_text;
257 * Custom Text to display on the submit button on profile edit/create screens
260 * (SQL type: varchar(64))
261 * Note that values will be retrieved from the database as a string.
263 public $submit_button_text;
266 * Should a Cancel button be included in this Profile form.
269 * (SQL type: tinyint)
270 * Note that values will be retrieved from the database as a string.
272 public $add_cancel_button;
277 public function __construct() {
278 $this->__table
= 'civicrm_uf_group';
279 parent
::__construct();
283 * Returns localized title of this entity.
285 * @param bool $plural
286 * Whether to return the plural version of the title.
288 public static function getEntityTitle($plural = FALSE) {
289 return $plural ?
ts('UFGroups') : ts('UFGroup');
293 * Returns foreign keys and entity references.
296 * [CRM_Core_Reference_Interface]
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']);
306 return Civi
::$statics[__CLASS__
]['links'];
310 * Returns all the column names of this table
314 public static function &fields() {
315 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
316 Civi
::$statics[__CLASS__
]['fields'] = [
319 'type' => CRM_Utils_Type
::T_INT
,
320 'title' => ts('Profile ID'),
321 'description' => ts('Unique table ID'),
323 'where' => 'civicrm_uf_group.id',
324 'table_name' => 'civicrm_uf_group',
325 'entity' => 'UFGroup',
326 'bao' => 'CRM_Core_BAO_UFGroup',
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.'),
340 'where' => 'civicrm_uf_group.is_active',
342 'table_name' => 'civicrm_uf_group',
343 'entity' => 'UFGroup',
344 'bao' => 'CRM_Core_BAO_UFGroup',
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.'),
354 'size' => CRM_Utils_Type
::HUGE
,
356 'where' => 'civicrm_uf_group.group_type',
358 'table_name' => 'civicrm_uf_group',
359 'entity' => 'UFGroup',
360 'bao' => 'CRM_Core_BAO_UFGroup',
362 'serialize' => self
::SERIALIZE_COMMA
,
367 'type' => CRM_Utils_Type
::T_STRING
,
368 'title' => ts('Profile Name'),
369 'description' => ts('Form title.'),
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',
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'),
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',
401 'name' => 'description',
402 'type' => CRM_Utils_Type
::T_TEXT
,
403 'title' => ts('Profile Description'),
404 'description' => ts('Optional verbose description of the profile.'),
407 'where' => 'civicrm_uf_group.description',
408 'table_name' => 'civicrm_uf_group',
409 'entity' => 'UFGroup',
410 'bao' => 'CRM_Core_BAO_UFGroup',
413 'type' => 'TextArea',
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.'),
424 'where' => 'civicrm_uf_group.help_pre',
425 'table_name' => 'civicrm_uf_group',
426 'entity' => 'UFGroup',
427 'bao' => 'CRM_Core_BAO_UFGroup',
430 'type' => 'TextArea',
431 'label' => ts("Pre Help"),
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.'),
442 'where' => 'civicrm_uf_group.help_post',
443 'table_name' => 'civicrm_uf_group',
444 'entity' => 'UFGroup',
445 'bao' => 'CRM_Core_BAO_UFGroup',
448 'type' => 'TextArea',
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',
462 'FKClassName' => 'CRM_Contact_DAO_Group',
464 'label' => ts("Search Limit Group"),
469 'name' => 'post_URL',
470 'type' => CRM_Utils_Type
::T_STRING
,
471 'title' => ts('Post Url'),
472 'description' => ts('Redirect to URL.'),
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',
481 'label' => ts("Post URL"),
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',
495 'FKClassName' => 'CRM_Contact_DAO_Group',
497 'label' => ts("Add Contact To Group"),
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.'),
507 'where' => 'civicrm_uf_group.add_captcha',
509 'table_name' => 'civicrm_uf_group',
510 'entity' => 'UFGroup',
511 'bao' => 'CRM_Core_BAO_UFGroup',
517 'type' => CRM_Utils_Type
::T_BOOLEAN
,
518 'title' => ts('Map Profile'),
519 'description' => ts('Do we want to map results from this profile.'),
521 'where' => 'civicrm_uf_group.is_map',
523 'table_name' => 'civicrm_uf_group',
524 'entity' => 'UFGroup',
525 'bao' => 'CRM_Core_BAO_UFGroup',
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'),
535 'where' => 'civicrm_uf_group.is_edit_link',
537 'table_name' => 'civicrm_uf_group',
538 'entity' => 'UFGroup',
539 'bao' => 'CRM_Core_BAO_UFGroup',
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'),
549 'where' => 'civicrm_uf_group.is_uf_link',
551 'table_name' => 'civicrm_uf_group',
552 'entity' => 'UFGroup',
553 'bao' => 'CRM_Core_BAO_UFGroup',
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'),
563 'where' => 'civicrm_uf_group.is_update_dupe',
565 'table_name' => 'civicrm_uf_group',
566 'entity' => 'UFGroup',
567 'bao' => 'CRM_Core_BAO_UFGroup',
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 .'),
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',
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 '),
591 'where' => 'civicrm_uf_group.is_cms_user',
593 'table_name' => 'civicrm_uf_group',
594 'entity' => 'UFGroup',
595 'bao' => 'CRM_Core_BAO_UFGroup',
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',
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?'),
616 'where' => 'civicrm_uf_group.is_reserved',
618 'table_name' => 'civicrm_uf_group',
619 'entity' => 'UFGroup',
620 'bao' => 'CRM_Core_BAO_UFGroup',
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'),
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',
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',
648 'FKClassName' => 'CRM_Contact_DAO_Contact',
650 'label' => ts("Created By"),
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',
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?'),
672 'where' => 'civicrm_uf_group.is_proximity_search',
674 'table_name' => 'civicrm_uf_group',
675 'entity' => 'UFGroup',
676 'bao' => 'CRM_Core_BAO_UFGroup',
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'),
686 'size' => CRM_Utils_Type
::BIG
,
687 'where' => 'civicrm_uf_group.cancel_button_text',
689 'table_name' => 'civicrm_uf_group',
690 'entity' => 'UFGroup',
691 'bao' => 'CRM_Core_BAO_UFGroup',
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'),
704 'size' => CRM_Utils_Type
::BIG
,
705 'where' => 'civicrm_uf_group.submit_button_text',
707 'table_name' => 'civicrm_uf_group',
708 'entity' => 'UFGroup',
709 'bao' => 'CRM_Core_BAO_UFGroup',
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.'),
722 'where' => 'civicrm_uf_group.add_cancel_button',
724 'table_name' => 'civicrm_uf_group',
725 'entity' => 'UFGroup',
726 'bao' => 'CRM_Core_BAO_UFGroup',
731 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
733 return Civi
::$statics[__CLASS__
]['fields'];
737 * Return a mapping from field-name to the corresponding key (as used in fields()).
740 * Array(string $name => string $uniqueName).
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()));
746 return Civi
::$statics[__CLASS__
]['fieldKeys'];
750 * Returns the names of this table
754 public static function getTableName() {
755 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
759 * Returns if this table needs to be logged
763 public function getLog() {
768 * Returns the list of fields that can be imported
770 * @param bool $prefix
774 public static function &import($prefix = FALSE) {
775 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'uf_group', $prefix, []);
780 * Returns the list of fields that can be exported
782 * @param bool $prefix
786 public static function &export($prefix = FALSE) {
787 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'uf_group', $prefix, []);
792 * Returns the list of indices
794 * @param bool $localize
798 public static function indices($localize = TRUE) {
805 'localizable' => FALSE,
807 'sig' => 'civicrm_uf_group::1::name',
810 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;