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:6d64e2deaff9b8408d4110c44d0e8152)
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.
45 * @var bool|string|null
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.
135 * @var bool|string|null
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.
144 * @var bool|string|null
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
153 * @var bool|string|null
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
162 * @var bool|string|null
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
171 * @var bool|string|null
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
189 * @var bool|string|null
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?
205 * @var bool|string|null
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?
241 * @var bool|string|null
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.
268 * @var bool|string|null
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.'),
339 'where' => 'civicrm_uf_group.is_active',
341 'table_name' => 'civicrm_uf_group',
342 'entity' => 'UFGroup',
343 'bao' => 'CRM_Core_BAO_UFGroup',
348 'name' => 'group_type',
349 'type' => CRM_Utils_Type
::T_STRING
,
350 'title' => ts('Profile Group Type'),
351 'description' => ts('Comma separated list of the type(s) of profile fields.'),
353 'size' => CRM_Utils_Type
::HUGE
,
355 'where' => 'civicrm_uf_group.group_type',
357 'table_name' => 'civicrm_uf_group',
358 'entity' => 'UFGroup',
359 'bao' => 'CRM_Core_BAO_UFGroup',
361 'serialize' => self
::SERIALIZE_COMMA
,
366 'type' => CRM_Utils_Type
::T_STRING
,
367 'title' => ts('Profile Name'),
368 'description' => ts('Form title.'),
371 'size' => CRM_Utils_Type
::BIG
,
372 'where' => 'civicrm_uf_group.title',
373 'table_name' => 'civicrm_uf_group',
374 'entity' => 'UFGroup',
375 'bao' => 'CRM_Core_BAO_UFGroup',
382 'frontend_title' => [
383 'name' => 'frontend_title',
384 'type' => CRM_Utils_Type
::T_STRING
,
385 'title' => ts('Public Title'),
386 'description' => ts('Profile Form Public title'),
388 'size' => CRM_Utils_Type
::BIG
,
389 'where' => 'civicrm_uf_group.frontend_title',
390 'table_name' => 'civicrm_uf_group',
391 'entity' => 'UFGroup',
392 'bao' => 'CRM_Core_BAO_UFGroup',
400 'name' => 'description',
401 'type' => CRM_Utils_Type
::T_TEXT
,
402 'title' => ts('Profile Description'),
403 'description' => ts('Optional verbose description of the profile.'),
406 'where' => 'civicrm_uf_group.description',
407 'table_name' => 'civicrm_uf_group',
408 'entity' => 'UFGroup',
409 'bao' => 'CRM_Core_BAO_UFGroup',
412 'type' => 'TextArea',
417 'name' => 'help_pre',
418 'type' => CRM_Utils_Type
::T_TEXT
,
419 'title' => ts('Help Pre'),
420 'description' => ts('Description and/or help text to display before fields in form.'),
423 'where' => 'civicrm_uf_group.help_pre',
424 'table_name' => 'civicrm_uf_group',
425 'entity' => 'UFGroup',
426 'bao' => 'CRM_Core_BAO_UFGroup',
429 'type' => 'TextArea',
430 'label' => ts("Pre Help"),
435 'name' => 'help_post',
436 'type' => CRM_Utils_Type
::T_TEXT
,
437 'title' => ts('Profile Post Text'),
438 'description' => ts('Description and/or help text to display after fields in form.'),
441 'where' => 'civicrm_uf_group.help_post',
442 'table_name' => 'civicrm_uf_group',
443 'entity' => 'UFGroup',
444 'bao' => 'CRM_Core_BAO_UFGroup',
447 'type' => 'TextArea',
451 'limit_listings_group_id' => [
452 'name' => 'limit_listings_group_id',
453 'type' => CRM_Utils_Type
::T_INT
,
454 'title' => ts('Search Limit Group ID'),
455 'description' => ts('Group id, foreign key from civicrm_group'),
456 'where' => 'civicrm_uf_group.limit_listings_group_id',
457 'table_name' => 'civicrm_uf_group',
458 'entity' => 'UFGroup',
459 'bao' => 'CRM_Core_BAO_UFGroup',
461 'FKClassName' => 'CRM_Contact_DAO_Group',
463 'label' => ts("Search Limit Group"),
468 'name' => 'post_URL',
469 'type' => CRM_Utils_Type
::T_STRING
,
470 'title' => ts('Post Url'),
471 'description' => ts('Redirect to URL.'),
473 'size' => CRM_Utils_Type
::HUGE
,
474 'where' => 'civicrm_uf_group.post_URL',
475 'table_name' => 'civicrm_uf_group',
476 'entity' => 'UFGroup',
477 'bao' => 'CRM_Core_BAO_UFGroup',
480 'label' => ts("Post URL"),
484 'add_to_group_id' => [
485 'name' => 'add_to_group_id',
486 'type' => CRM_Utils_Type
::T_INT
,
487 'title' => ts('Add Contact To Group ID'),
488 'description' => ts('foreign key to civicrm_group_id'),
489 'where' => 'civicrm_uf_group.add_to_group_id',
490 'table_name' => 'civicrm_uf_group',
491 'entity' => 'UFGroup',
492 'bao' => 'CRM_Core_BAO_UFGroup',
494 'FKClassName' => 'CRM_Contact_DAO_Group',
496 'label' => ts("Add Contact To Group"),
501 'name' => 'add_captcha',
502 'type' => CRM_Utils_Type
::T_BOOLEAN
,
503 'title' => ts('Show Captcha On Profile'),
504 'description' => ts('Should a CAPTCHA widget be included this Profile form.'),
505 'where' => 'civicrm_uf_group.add_captcha',
507 'table_name' => 'civicrm_uf_group',
508 'entity' => 'UFGroup',
509 'bao' => 'CRM_Core_BAO_UFGroup',
515 'type' => CRM_Utils_Type
::T_BOOLEAN
,
516 'title' => ts('Map Profile'),
517 'description' => ts('Do we want to map results from this profile.'),
518 'where' => 'civicrm_uf_group.is_map',
520 'table_name' => 'civicrm_uf_group',
521 'entity' => 'UFGroup',
522 'bao' => 'CRM_Core_BAO_UFGroup',
527 'name' => 'is_edit_link',
528 'type' => CRM_Utils_Type
::T_BOOLEAN
,
529 'title' => ts('Show Edit Link?'),
530 'description' => ts('Should edit link display in profile selector'),
531 'where' => 'civicrm_uf_group.is_edit_link',
533 'table_name' => 'civicrm_uf_group',
534 'entity' => 'UFGroup',
535 'bao' => 'CRM_Core_BAO_UFGroup',
540 'name' => 'is_uf_link',
541 'type' => CRM_Utils_Type
::T_BOOLEAN
,
542 'title' => ts('Show Link to CMS User'),
543 'description' => ts('Should we display a link to the website profile in profile selector'),
544 'where' => 'civicrm_uf_group.is_uf_link',
546 'table_name' => 'civicrm_uf_group',
547 'entity' => 'UFGroup',
548 'bao' => 'CRM_Core_BAO_UFGroup',
552 'is_update_dupe' => [
553 'name' => 'is_update_dupe',
554 'type' => CRM_Utils_Type
::T_BOOLEAN
,
555 'title' => ts('Update on Duplicate'),
556 'description' => ts('Should we update the contact record if we find a duplicate'),
557 'where' => 'civicrm_uf_group.is_update_dupe',
559 'table_name' => 'civicrm_uf_group',
560 'entity' => 'UFGroup',
561 'bao' => 'CRM_Core_BAO_UFGroup',
566 'name' => 'cancel_URL',
567 'type' => CRM_Utils_Type
::T_STRING
,
568 'title' => ts('Profile Cancel URL'),
569 'description' => ts('Redirect to URL when Cancle button clik .'),
571 'size' => CRM_Utils_Type
::HUGE
,
572 'where' => 'civicrm_uf_group.cancel_URL',
573 'table_name' => 'civicrm_uf_group',
574 'entity' => 'UFGroup',
575 'bao' => 'CRM_Core_BAO_UFGroup',
580 'name' => 'is_cms_user',
581 'type' => CRM_Utils_Type
::T_BOOLEAN
,
582 'title' => ts('Create CMS User?'),
583 'description' => ts('Should we create a cms user for this profile '),
584 'where' => 'civicrm_uf_group.is_cms_user',
586 'table_name' => 'civicrm_uf_group',
587 'entity' => 'UFGroup',
588 'bao' => 'CRM_Core_BAO_UFGroup',
594 'type' => CRM_Utils_Type
::T_TEXT
,
595 'title' => ts('Notify on Profile Submit'),
596 'where' => 'civicrm_uf_group.notify',
597 'table_name' => 'civicrm_uf_group',
598 'entity' => 'UFGroup',
599 'bao' => 'CRM_Core_BAO_UFGroup',
604 'name' => 'is_reserved',
605 'type' => CRM_Utils_Type
::T_BOOLEAN
,
606 'title' => ts('Profile Is Reserved'),
607 'description' => ts('Is this group reserved for use by some other CiviCRM functionality?'),
608 'where' => 'civicrm_uf_group.is_reserved',
609 'table_name' => 'civicrm_uf_group',
610 'entity' => 'UFGroup',
611 'bao' => 'CRM_Core_BAO_UFGroup',
617 'type' => CRM_Utils_Type
::T_STRING
,
618 'title' => ts('Profile Name'),
619 'description' => ts('Name of the UF group for directly addressing it in the codebase'),
621 'size' => CRM_Utils_Type
::BIG
,
622 'where' => 'civicrm_uf_group.name',
623 'table_name' => 'civicrm_uf_group',
624 'entity' => 'UFGroup',
625 'bao' => 'CRM_Core_BAO_UFGroup',
630 'name' => 'created_id',
631 'type' => CRM_Utils_Type
::T_INT
,
632 'title' => ts('Created By Contact ID'),
633 'description' => ts('FK to civicrm_contact, who created this UF group'),
634 'where' => 'civicrm_uf_group.created_id',
635 'table_name' => 'civicrm_uf_group',
636 'entity' => 'UFGroup',
637 'bao' => 'CRM_Core_BAO_UFGroup',
639 'FKClassName' => 'CRM_Contact_DAO_Contact',
641 'label' => ts("Created By"),
646 'name' => 'created_date',
647 'type' => CRM_Utils_Type
::T_DATE + CRM_Utils_Type
::T_TIME
,
648 'title' => ts('UF Group Created Date'),
649 'description' => ts('Date and time this UF group was created.'),
650 'where' => 'civicrm_uf_group.created_date',
651 'table_name' => 'civicrm_uf_group',
652 'entity' => 'UFGroup',
653 'bao' => 'CRM_Core_BAO_UFGroup',
657 'is_proximity_search' => [
658 'name' => 'is_proximity_search',
659 'type' => CRM_Utils_Type
::T_BOOLEAN
,
660 'title' => ts('Include Proximity Search?'),
661 'description' => ts('Should we include proximity search feature in this profile search form?'),
662 'where' => 'civicrm_uf_group.is_proximity_search',
664 'table_name' => 'civicrm_uf_group',
665 'entity' => 'UFGroup',
666 'bao' => 'CRM_Core_BAO_UFGroup',
670 'cancel_button_text' => [
671 'name' => 'cancel_button_text',
672 'type' => CRM_Utils_Type
::T_STRING
,
673 'title' => ts('Cancel Button Text'),
674 'description' => ts('Custom Text to display on the Cancel button when used in create or edit mode'),
676 'size' => CRM_Utils_Type
::BIG
,
677 'where' => 'civicrm_uf_group.cancel_button_text',
679 'table_name' => 'civicrm_uf_group',
680 'entity' => 'UFGroup',
681 'bao' => 'CRM_Core_BAO_UFGroup',
688 'submit_button_text' => [
689 'name' => 'submit_button_text',
690 'type' => CRM_Utils_Type
::T_STRING
,
691 'title' => ts('Submit Button Text'),
692 'description' => ts('Custom Text to display on the submit button on profile edit/create screens'),
694 'size' => CRM_Utils_Type
::BIG
,
695 'where' => 'civicrm_uf_group.submit_button_text',
697 'table_name' => 'civicrm_uf_group',
698 'entity' => 'UFGroup',
699 'bao' => 'CRM_Core_BAO_UFGroup',
706 'add_cancel_button' => [
707 'name' => 'add_cancel_button',
708 'type' => CRM_Utils_Type
::T_BOOLEAN
,
709 'title' => ts('Include Cancel Button'),
710 'description' => ts('Should a Cancel button be included in this Profile form.'),
711 'where' => 'civicrm_uf_group.add_cancel_button',
713 'table_name' => 'civicrm_uf_group',
714 'entity' => 'UFGroup',
715 'bao' => 'CRM_Core_BAO_UFGroup',
720 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
722 return Civi
::$statics[__CLASS__
]['fields'];
726 * Return a mapping from field-name to the corresponding key (as used in fields()).
729 * Array(string $name => string $uniqueName).
731 public static function &fieldKeys() {
732 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
733 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
735 return Civi
::$statics[__CLASS__
]['fieldKeys'];
739 * Returns the names of this table
743 public static function getTableName() {
744 return CRM_Core_DAO
::getLocaleTableName(self
::$_tableName);
748 * Returns if this table needs to be logged
752 public function getLog() {
757 * Returns the list of fields that can be imported
759 * @param bool $prefix
763 public static function &import($prefix = FALSE) {
764 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'uf_group', $prefix, []);
769 * Returns the list of fields that can be exported
771 * @param bool $prefix
775 public static function &export($prefix = FALSE) {
776 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'uf_group', $prefix, []);
781 * Returns the list of indices
783 * @param bool $localize
787 public static function indices($localize = TRUE) {
794 'localizable' => FALSE,
796 'sig' => 'civicrm_uf_group::1::name',
799 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;