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