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