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