Merge pull request #14154 from greenpeace-cee/fix-quicksearch-font
[civicrm-core.git] / CRM / Contact / DAO / Contact.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2019
6 *
7 * Generated from xml/schema/CRM/Contact/Contact.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:e2181ea97a3e309b7e74b636757b6aac)
10 */
11
12 /**
13 * Database access object for the Contact entity.
14 */
15 class CRM_Contact_DAO_Contact extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_contact';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 public static $_log = TRUE;
30
31 /**
32 * Unique Contact ID
33 *
34 * @var int
35 */
36 public $id;
37
38 /**
39 * Type of Contact.
40 *
41 * @var string
42 */
43 public $contact_type;
44
45 /**
46 * May be used to over-ride contact view and edit templates.
47 *
48 * @var string
49 */
50 public $contact_sub_type;
51
52 /**
53 * @var bool
54 */
55 public $do_not_email;
56
57 /**
58 * @var bool
59 */
60 public $do_not_phone;
61
62 /**
63 * @var bool
64 */
65 public $do_not_mail;
66
67 /**
68 * @var bool
69 */
70 public $do_not_sms;
71
72 /**
73 * @var bool
74 */
75 public $do_not_trade;
76
77 /**
78 * Has the contact opted out from receiving all bulk email from the organization or site domain?
79 *
80 * @var bool
81 */
82 public $is_opt_out;
83
84 /**
85 * May be used for SSN, EIN/TIN, Household ID (census) or other applicable unique legal/government ID.
86 *
87 * @var string
88 */
89 public $legal_identifier;
90
91 /**
92 * Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations.
93 *
94 * @var string
95 */
96 public $external_identifier;
97
98 /**
99 * Name used for sorting different contact types
100 *
101 * @var string
102 */
103 public $sort_name;
104
105 /**
106 * Formatted name representing preferred format for display/print/other output.
107 *
108 * @var string
109 */
110 public $display_name;
111
112 /**
113 * Nickname.
114 *
115 * @var string
116 */
117 public $nick_name;
118
119 /**
120 * Legal Name.
121 *
122 * @var string
123 */
124 public $legal_name;
125
126 /**
127 * optional URL for preferred image (photo, logo, etc.) to display for this contact.
128 *
129 * @var text
130 */
131 public $image_URL;
132
133 /**
134 * What is the preferred mode of communication.
135 *
136 * @var string
137 */
138 public $preferred_communication_method;
139
140 /**
141 * Which language is preferred for communication. FK to languages in civicrm_option_value.
142 *
143 * @var string
144 */
145 public $preferred_language;
146
147 /**
148 * What is the preferred mode of sending an email.
149 *
150 * @var string
151 */
152 public $preferred_mail_format;
153
154 /**
155 * Key for validating requests related to this contact.
156 *
157 * @var string
158 */
159 public $hash;
160
161 /**
162 * API Key for validating requests related to this contact.
163 *
164 * @var string
165 */
166 public $api_key;
167
168 /**
169 * where contact come from, e.g. import, donate module insert...
170 *
171 * @var string
172 */
173 public $source;
174
175 /**
176 * First Name.
177 *
178 * @var string
179 */
180 public $first_name;
181
182 /**
183 * Middle Name.
184 *
185 * @var string
186 */
187 public $middle_name;
188
189 /**
190 * Last Name.
191 *
192 * @var string
193 */
194 public $last_name;
195
196 /**
197 * Prefix or Title for name (Ms, Mr...). FK to prefix ID
198 *
199 * @var int
200 */
201 public $prefix_id;
202
203 /**
204 * Suffix for name (Jr, Sr...). FK to suffix ID
205 *
206 * @var int
207 */
208 public $suffix_id;
209
210 /**
211 * Formal (academic or similar) title in front of name. (Prof., Dr. etc.)
212 *
213 * @var string
214 */
215 public $formal_title;
216
217 /**
218 * Communication style (e.g. formal vs. familiar) to use with this contact. FK to communication styles in civicrm_option_value.
219 *
220 * @var int
221 */
222 public $communication_style_id;
223
224 /**
225 * FK to civicrm_option_value.id, that has to be valid registered Email Greeting.
226 *
227 * @var int
228 */
229 public $email_greeting_id;
230
231 /**
232 * Custom Email Greeting.
233 *
234 * @var string
235 */
236 public $email_greeting_custom;
237
238 /**
239 * Cache Email Greeting.
240 *
241 * @var string
242 */
243 public $email_greeting_display;
244
245 /**
246 * FK to civicrm_option_value.id, that has to be valid registered Postal Greeting.
247 *
248 * @var int
249 */
250 public $postal_greeting_id;
251
252 /**
253 * Custom Postal greeting.
254 *
255 * @var string
256 */
257 public $postal_greeting_custom;
258
259 /**
260 * Cache Postal greeting.
261 *
262 * @var string
263 */
264 public $postal_greeting_display;
265
266 /**
267 * FK to civicrm_option_value.id, that has to be valid registered Addressee.
268 *
269 * @var int
270 */
271 public $addressee_id;
272
273 /**
274 * Custom Addressee.
275 *
276 * @var string
277 */
278 public $addressee_custom;
279
280 /**
281 * Cache Addressee.
282 *
283 * @var string
284 */
285 public $addressee_display;
286
287 /**
288 * Job Title
289 *
290 * @var string
291 */
292 public $job_title;
293
294 /**
295 * FK to gender ID
296 *
297 * @var int
298 */
299 public $gender_id;
300
301 /**
302 * Date of birth
303 *
304 * @var date
305 */
306 public $birth_date;
307
308 /**
309 * @var bool
310 */
311 public $is_deceased;
312
313 /**
314 * Date of deceased
315 *
316 * @var date
317 */
318 public $deceased_date;
319
320 /**
321 * Household Name.
322 *
323 * @var string
324 */
325 public $household_name;
326
327 /**
328 * Optional FK to Primary Contact for this household.
329 *
330 * @var int
331 */
332 public $primary_contact_id;
333
334 /**
335 * Organization Name.
336 *
337 * @var string
338 */
339 public $organization_name;
340
341 /**
342 * Standard Industry Classification Code.
343 *
344 * @var string
345 */
346 public $sic_code;
347
348 /**
349 * the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM
350 *
351 * @var string
352 */
353 public $user_unique_id;
354
355 /**
356 * OPTIONAL FK to civicrm_contact record.
357 *
358 * @var int
359 */
360 public $employer_id;
361
362 /**
363 * @var bool
364 */
365 public $is_deleted;
366
367 /**
368 * When was the contact was created.
369 *
370 * @var timestamp
371 */
372 public $created_date;
373
374 /**
375 * When was the contact (or closely related entity) was created or modified or deleted.
376 *
377 * @var timestamp
378 */
379 public $modified_date;
380
381 /**
382 * Class constructor.
383 */
384 public function __construct() {
385 $this->__table = 'civicrm_contact';
386 parent::__construct();
387 }
388
389 /**
390 * Returns foreign keys and entity references.
391 *
392 * @return array
393 * [CRM_Core_Reference_Interface]
394 */
395 public static function getReferenceColumns() {
396 if (!isset(Civi::$statics[__CLASS__]['links'])) {
397 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
398 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'primary_contact_id', 'civicrm_contact', 'id');
399 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'employer_id', 'civicrm_contact', 'id');
400 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
401 }
402 return Civi::$statics[__CLASS__]['links'];
403 }
404
405 /**
406 * Returns all the column names of this table
407 *
408 * @return array
409 */
410 public static function &fields() {
411 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
412 Civi::$statics[__CLASS__]['fields'] = [
413 'id' => [
414 'name' => 'id',
415 'type' => CRM_Utils_Type::T_INT,
416 'title' => ts('Contact ID'),
417 'description' => ts('Unique Contact ID'),
418 'required' => TRUE,
419 'import' => TRUE,
420 'where' => 'civicrm_contact.id',
421 'headerPattern' => '/internal|contact?|id$/i',
422 'export' => TRUE,
423 'table_name' => 'civicrm_contact',
424 'entity' => 'Contact',
425 'bao' => 'CRM_Contact_BAO_Contact',
426 'localizable' => 0,
427 ],
428 'contact_type' => [
429 'name' => 'contact_type',
430 'type' => CRM_Utils_Type::T_STRING,
431 'title' => ts('Contact Type'),
432 'description' => ts('Type of Contact.'),
433 'maxlength' => 64,
434 'size' => CRM_Utils_Type::BIG,
435 'where' => 'civicrm_contact.contact_type',
436 'export' => TRUE,
437 'table_name' => 'civicrm_contact',
438 'entity' => 'Contact',
439 'bao' => 'CRM_Contact_BAO_Contact',
440 'localizable' => 0,
441 'html' => [
442 'type' => 'Select',
443 ],
444 'pseudoconstant' => [
445 'table' => 'civicrm_contact_type',
446 'keyColumn' => 'name',
447 'labelColumn' => 'label',
448 'condition' => 'parent_id IS NULL',
449 ],
450 ],
451 'contact_sub_type' => [
452 'name' => 'contact_sub_type',
453 'type' => CRM_Utils_Type::T_STRING,
454 'title' => ts('Contact Subtype'),
455 'description' => ts('May be used to over-ride contact view and edit templates.'),
456 'maxlength' => 255,
457 'size' => CRM_Utils_Type::HUGE,
458 'import' => TRUE,
459 'where' => 'civicrm_contact.contact_sub_type',
460 'headerPattern' => '/C(ontact )?(subtype|sub-type|sub type)/i',
461 'export' => TRUE,
462 'table_name' => 'civicrm_contact',
463 'entity' => 'Contact',
464 'bao' => 'CRM_Contact_BAO_Contact',
465 'localizable' => 0,
466 'serialize' => self::SERIALIZE_SEPARATOR_BOOKEND,
467 'html' => [
468 'type' => 'Select',
469 ],
470 'pseudoconstant' => [
471 'table' => 'civicrm_contact_type',
472 'keyColumn' => 'name',
473 'labelColumn' => 'label',
474 'condition' => 'parent_id IS NOT NULL',
475 ],
476 ],
477 'do_not_email' => [
478 'name' => 'do_not_email',
479 'type' => CRM_Utils_Type::T_BOOLEAN,
480 'title' => ts('Do Not Email'),
481 'import' => TRUE,
482 'where' => 'civicrm_contact.do_not_email',
483 'headerPattern' => '/d(o )?(not )?(email)/i',
484 'dataPattern' => '/^\d{1,}$/',
485 'export' => TRUE,
486 'default' => '0',
487 'table_name' => 'civicrm_contact',
488 'entity' => 'Contact',
489 'bao' => 'CRM_Contact_BAO_Contact',
490 'localizable' => 0,
491 'html' => [
492 'type' => 'CheckBox',
493 ],
494 ],
495 'do_not_phone' => [
496 'name' => 'do_not_phone',
497 'type' => CRM_Utils_Type::T_BOOLEAN,
498 'title' => ts('Do Not Phone'),
499 'import' => TRUE,
500 'where' => 'civicrm_contact.do_not_phone',
501 'headerPattern' => '/d(o )?(not )?(call|phone)/i',
502 'dataPattern' => '/^\d{1,}$/',
503 'export' => TRUE,
504 'default' => '0',
505 'table_name' => 'civicrm_contact',
506 'entity' => 'Contact',
507 'bao' => 'CRM_Contact_BAO_Contact',
508 'localizable' => 0,
509 'html' => [
510 'type' => 'CheckBox',
511 ],
512 ],
513 'do_not_mail' => [
514 'name' => 'do_not_mail',
515 'type' => CRM_Utils_Type::T_BOOLEAN,
516 'title' => ts('Do Not Mail'),
517 'import' => TRUE,
518 'where' => 'civicrm_contact.do_not_mail',
519 'headerPattern' => '/^(d(o\s)?n(ot\s)?mail)|(\w*)?bulk\s?(\w*)$/i',
520 'dataPattern' => '/^\d{1,}$/',
521 'export' => TRUE,
522 'default' => '0',
523 'table_name' => 'civicrm_contact',
524 'entity' => 'Contact',
525 'bao' => 'CRM_Contact_BAO_Contact',
526 'localizable' => 0,
527 'html' => [
528 'type' => 'CheckBox',
529 ],
530 ],
531 'do_not_sms' => [
532 'name' => 'do_not_sms',
533 'type' => CRM_Utils_Type::T_BOOLEAN,
534 'title' => ts('Do Not Sms'),
535 'import' => TRUE,
536 'where' => 'civicrm_contact.do_not_sms',
537 'headerPattern' => '/d(o )?(not )?(sms)/i',
538 'dataPattern' => '/^\d{1,}$/',
539 'export' => TRUE,
540 'default' => '0',
541 'table_name' => 'civicrm_contact',
542 'entity' => 'Contact',
543 'bao' => 'CRM_Contact_BAO_Contact',
544 'localizable' => 0,
545 'html' => [
546 'type' => 'CheckBox',
547 ],
548 ],
549 'do_not_trade' => [
550 'name' => 'do_not_trade',
551 'type' => CRM_Utils_Type::T_BOOLEAN,
552 'title' => ts('Do Not Trade'),
553 'import' => TRUE,
554 'where' => 'civicrm_contact.do_not_trade',
555 'headerPattern' => '/d(o )?(not )?(trade)/i',
556 'dataPattern' => '/^\d{1,}$/',
557 'export' => TRUE,
558 'default' => '0',
559 'table_name' => 'civicrm_contact',
560 'entity' => 'Contact',
561 'bao' => 'CRM_Contact_BAO_Contact',
562 'localizable' => 0,
563 'html' => [
564 'type' => 'CheckBox',
565 ],
566 ],
567 'is_opt_out' => [
568 'name' => 'is_opt_out',
569 'type' => CRM_Utils_Type::T_BOOLEAN,
570 'title' => ts('No Bulk Emails (User Opt Out)'),
571 'description' => ts('Has the contact opted out from receiving all bulk email from the organization or site domain?'),
572 'required' => TRUE,
573 'import' => TRUE,
574 'where' => 'civicrm_contact.is_opt_out',
575 'export' => TRUE,
576 'default' => '0',
577 'table_name' => 'civicrm_contact',
578 'entity' => 'Contact',
579 'bao' => 'CRM_Contact_BAO_Contact',
580 'localizable' => 0,
581 'html' => [
582 'type' => 'CheckBox',
583 ],
584 ],
585 'legal_identifier' => [
586 'name' => 'legal_identifier',
587 'type' => CRM_Utils_Type::T_STRING,
588 'title' => ts('Legal Identifier'),
589 'description' => ts('May be used for SSN, EIN/TIN, Household ID (census) or other applicable unique legal/government ID.'),
590 'maxlength' => 32,
591 'size' => CRM_Utils_Type::MEDIUM,
592 'import' => TRUE,
593 'where' => 'civicrm_contact.legal_identifier',
594 'headerPattern' => '/legal\s?id/i',
595 'dataPattern' => '/\w+?\d{5,}/',
596 'export' => TRUE,
597 'table_name' => 'civicrm_contact',
598 'entity' => 'Contact',
599 'bao' => 'CRM_Contact_BAO_Contact',
600 'localizable' => 0,
601 'html' => [
602 'type' => 'Text',
603 ],
604 ],
605 'external_identifier' => [
606 'name' => 'external_identifier',
607 'type' => CRM_Utils_Type::T_STRING,
608 'title' => ts('External Identifier'),
609 'description' => ts('Unique trusted external ID (generally from a legacy app/datasource). Particularly useful for deduping operations.'),
610 'maxlength' => 64,
611 'size' => 8,
612 'import' => TRUE,
613 'where' => 'civicrm_contact.external_identifier',
614 'headerPattern' => '/external\s?id/i',
615 'dataPattern' => '/^\d{11,}$/',
616 'export' => TRUE,
617 'table_name' => 'civicrm_contact',
618 'entity' => 'Contact',
619 'bao' => 'CRM_Contact_BAO_Contact',
620 'localizable' => 0,
621 'html' => [
622 'type' => 'Text',
623 ],
624 ],
625 'sort_name' => [
626 'name' => 'sort_name',
627 'type' => CRM_Utils_Type::T_STRING,
628 'title' => ts('Sort Name'),
629 'description' => ts('Name used for sorting different contact types'),
630 'maxlength' => 128,
631 'size' => 30,
632 'where' => 'civicrm_contact.sort_name',
633 'export' => TRUE,
634 'table_name' => 'civicrm_contact',
635 'entity' => 'Contact',
636 'bao' => 'CRM_Contact_BAO_Contact',
637 'localizable' => 0,
638 'html' => [
639 'type' => 'Text',
640 ],
641 ],
642 'display_name' => [
643 'name' => 'display_name',
644 'type' => CRM_Utils_Type::T_STRING,
645 'title' => ts('Display Name'),
646 'description' => ts('Formatted name representing preferred format for display/print/other output.'),
647 'maxlength' => 128,
648 'size' => 30,
649 'where' => 'civicrm_contact.display_name',
650 'export' => TRUE,
651 'table_name' => 'civicrm_contact',
652 'entity' => 'Contact',
653 'bao' => 'CRM_Contact_BAO_Contact',
654 'localizable' => 0,
655 'html' => [
656 'type' => 'Text',
657 ],
658 ],
659 'nick_name' => [
660 'name' => 'nick_name',
661 'type' => CRM_Utils_Type::T_STRING,
662 'title' => ts('Nickname'),
663 'description' => ts('Nickname.'),
664 'maxlength' => 128,
665 'size' => 30,
666 'import' => TRUE,
667 'where' => 'civicrm_contact.nick_name',
668 'headerPattern' => '/n(ick\s)name|nick$/i',
669 'dataPattern' => '/^\w+$/',
670 'export' => TRUE,
671 'table_name' => 'civicrm_contact',
672 'entity' => 'Contact',
673 'bao' => 'CRM_Contact_BAO_Contact',
674 'localizable' => 0,
675 'html' => [
676 'type' => 'Text',
677 ],
678 ],
679 'legal_name' => [
680 'name' => 'legal_name',
681 'type' => CRM_Utils_Type::T_STRING,
682 'title' => ts('Legal Name'),
683 'description' => ts('Legal Name.'),
684 'maxlength' => 128,
685 'size' => 30,
686 'import' => TRUE,
687 'where' => 'civicrm_contact.legal_name',
688 'headerPattern' => '/^legal|(l(egal\s)?name)$/i',
689 'export' => TRUE,
690 'table_name' => 'civicrm_contact',
691 'entity' => 'Contact',
692 'bao' => 'CRM_Contact_BAO_Contact',
693 'localizable' => 0,
694 'html' => [
695 'type' => 'Text',
696 ],
697 ],
698 'image_URL' => [
699 'name' => 'image_URL',
700 'type' => CRM_Utils_Type::T_TEXT,
701 'title' => ts('Image Url'),
702 'description' => ts('optional URL for preferred image (photo, logo, etc.) to display for this contact.'),
703 'import' => TRUE,
704 'where' => 'civicrm_contact.image_URL',
705 'export' => TRUE,
706 'table_name' => 'civicrm_contact',
707 'entity' => 'Contact',
708 'bao' => 'CRM_Contact_BAO_Contact',
709 'localizable' => 0,
710 'html' => [
711 'type' => 'File',
712 ],
713 ],
714 'preferred_communication_method' => [
715 'name' => 'preferred_communication_method',
716 'type' => CRM_Utils_Type::T_STRING,
717 'title' => ts('Preferred Communication Method'),
718 'description' => ts('What is the preferred mode of communication.'),
719 'maxlength' => 255,
720 'size' => CRM_Utils_Type::HUGE,
721 'import' => TRUE,
722 'where' => 'civicrm_contact.preferred_communication_method',
723 'headerPattern' => '/^p(ref\w*\s)?c(omm\w*)|( meth\w*)$/i',
724 'dataPattern' => '/^\w+$/',
725 'export' => TRUE,
726 'table_name' => 'civicrm_contact',
727 'entity' => 'Contact',
728 'bao' => 'CRM_Contact_BAO_Contact',
729 'localizable' => 0,
730 'serialize' => self::SERIALIZE_SEPARATOR_BOOKEND,
731 'html' => [
732 'type' => 'Select',
733 ],
734 'pseudoconstant' => [
735 'optionGroupName' => 'preferred_communication_method',
736 'optionEditPath' => 'civicrm/admin/options/preferred_communication_method',
737 ],
738 ],
739 'preferred_language' => [
740 'name' => 'preferred_language',
741 'type' => CRM_Utils_Type::T_STRING,
742 'title' => ts('Preferred Language'),
743 'description' => ts('Which language is preferred for communication. FK to languages in civicrm_option_value.'),
744 'maxlength' => 5,
745 'size' => CRM_Utils_Type::SIX,
746 'import' => TRUE,
747 'where' => 'civicrm_contact.preferred_language',
748 'headerPattern' => '/^lang/i',
749 'export' => TRUE,
750 'table_name' => 'civicrm_contact',
751 'entity' => 'Contact',
752 'bao' => 'CRM_Contact_BAO_Contact',
753 'localizable' => 0,
754 'html' => [
755 'type' => 'Select',
756 ],
757 'pseudoconstant' => [
758 'optionGroupName' => 'languages',
759 'keyColumn' => 'name',
760 'optionEditPath' => 'civicrm/admin/options/languages',
761 ],
762 ],
763 'preferred_mail_format' => [
764 'name' => 'preferred_mail_format',
765 'type' => CRM_Utils_Type::T_STRING,
766 'title' => ts('Preferred Mail Format'),
767 'description' => ts('What is the preferred mode of sending an email.'),
768 'maxlength' => 8,
769 'size' => CRM_Utils_Type::EIGHT,
770 'import' => TRUE,
771 'where' => 'civicrm_contact.preferred_mail_format',
772 'headerPattern' => '/^p(ref\w*\s)?m(ail\s)?f(orm\w*)$/i',
773 'export' => TRUE,
774 'default' => 'Both',
775 'table_name' => 'civicrm_contact',
776 'entity' => 'Contact',
777 'bao' => 'CRM_Contact_BAO_Contact',
778 'localizable' => 0,
779 'html' => [
780 'type' => 'Select',
781 ],
782 'pseudoconstant' => [
783 'callback' => 'CRM_Core_SelectValues::pmf',
784 ],
785 ],
786 'hash' => [
787 'name' => 'hash',
788 'type' => CRM_Utils_Type::T_STRING,
789 'title' => ts('Contact Hash'),
790 'description' => ts('Key for validating requests related to this contact.'),
791 'maxlength' => 32,
792 'size' => CRM_Utils_Type::MEDIUM,
793 'where' => 'civicrm_contact.hash',
794 'export' => TRUE,
795 'table_name' => 'civicrm_contact',
796 'entity' => 'Contact',
797 'bao' => 'CRM_Contact_BAO_Contact',
798 'localizable' => 0,
799 ],
800 'api_key' => [
801 'name' => 'api_key',
802 'type' => CRM_Utils_Type::T_STRING,
803 'title' => ts('Api Key'),
804 'description' => ts('API Key for validating requests related to this contact.'),
805 'maxlength' => 32,
806 'size' => CRM_Utils_Type::MEDIUM,
807 'where' => 'civicrm_contact.api_key',
808 'protected' => 'true',
809 'table_name' => 'civicrm_contact',
810 'entity' => 'Contact',
811 'bao' => 'CRM_Contact_BAO_Contact',
812 'localizable' => 0,
813 ],
814 'contact_source' => [
815 'name' => 'source',
816 'type' => CRM_Utils_Type::T_STRING,
817 'title' => ts('Contact Source'),
818 'description' => ts('where contact come from, e.g. import, donate module insert...'),
819 'maxlength' => 255,
820 'size' => 30,
821 'import' => TRUE,
822 'where' => 'civicrm_contact.source',
823 'headerPattern' => '/(C(ontact\s)?Source)$/i',
824 'export' => TRUE,
825 'table_name' => 'civicrm_contact',
826 'entity' => 'Contact',
827 'bao' => 'CRM_Contact_BAO_Contact',
828 'localizable' => 0,
829 'html' => [
830 'type' => 'Text',
831 ],
832 ],
833 'first_name' => [
834 'name' => 'first_name',
835 'type' => CRM_Utils_Type::T_STRING,
836 'title' => ts('First Name'),
837 'description' => ts('First Name.'),
838 'maxlength' => 64,
839 'size' => 30,
840 'import' => TRUE,
841 'where' => 'civicrm_contact.first_name',
842 'headerPattern' => '/^first|(f(irst\s)?name)$/i',
843 'dataPattern' => '/^\w+$/',
844 'export' => TRUE,
845 'table_name' => 'civicrm_contact',
846 'entity' => 'Contact',
847 'bao' => 'CRM_Contact_BAO_Contact',
848 'localizable' => 0,
849 'html' => [
850 'type' => 'Text',
851 ],
852 ],
853 'middle_name' => [
854 'name' => 'middle_name',
855 'type' => CRM_Utils_Type::T_STRING,
856 'title' => ts('Middle Name'),
857 'description' => ts('Middle Name.'),
858 'maxlength' => 64,
859 'size' => 30,
860 'import' => TRUE,
861 'where' => 'civicrm_contact.middle_name',
862 'headerPattern' => '/^middle|(m(iddle\s)?name)$/i',
863 'dataPattern' => '/^\w+$/',
864 'export' => TRUE,
865 'table_name' => 'civicrm_contact',
866 'entity' => 'Contact',
867 'bao' => 'CRM_Contact_BAO_Contact',
868 'localizable' => 0,
869 'html' => [
870 'type' => 'Text',
871 ],
872 ],
873 'last_name' => [
874 'name' => 'last_name',
875 'type' => CRM_Utils_Type::T_STRING,
876 'title' => ts('Last Name'),
877 'description' => ts('Last Name.'),
878 'maxlength' => 64,
879 'size' => 30,
880 'import' => TRUE,
881 'where' => 'civicrm_contact.last_name',
882 'headerPattern' => '/^last|(l(ast\s)?name)$/i',
883 'dataPattern' => '/^\w+(\s\w+)?+$/',
884 'export' => TRUE,
885 'table_name' => 'civicrm_contact',
886 'entity' => 'Contact',
887 'bao' => 'CRM_Contact_BAO_Contact',
888 'localizable' => 0,
889 'html' => [
890 'type' => 'Text',
891 ],
892 ],
893 'prefix_id' => [
894 'name' => 'prefix_id',
895 'type' => CRM_Utils_Type::T_INT,
896 'title' => ts('Individual Prefix'),
897 'description' => ts('Prefix or Title for name (Ms, Mr...). FK to prefix ID'),
898 'import' => TRUE,
899 'where' => 'civicrm_contact.prefix_id',
900 'headerPattern' => '/^(prefix|title)/i',
901 'dataPattern' => '/^(mr|ms|mrs|sir|dr)\.?$/i',
902 'export' => TRUE,
903 'table_name' => 'civicrm_contact',
904 'entity' => 'Contact',
905 'bao' => 'CRM_Contact_BAO_Contact',
906 'localizable' => 0,
907 'html' => [
908 'type' => 'Select',
909 ],
910 'pseudoconstant' => [
911 'optionGroupName' => 'individual_prefix',
912 'optionEditPath' => 'civicrm/admin/options/individual_prefix',
913 ],
914 ],
915 'suffix_id' => [
916 'name' => 'suffix_id',
917 'type' => CRM_Utils_Type::T_INT,
918 'title' => ts('Individual Suffix'),
919 'description' => ts('Suffix for name (Jr, Sr...). FK to suffix ID'),
920 'import' => TRUE,
921 'where' => 'civicrm_contact.suffix_id',
922 'headerPattern' => '/^suffix$/i',
923 'dataPattern' => '/^(sr|jr)\.?|i{2,}$/',
924 'export' => TRUE,
925 'table_name' => 'civicrm_contact',
926 'entity' => 'Contact',
927 'bao' => 'CRM_Contact_BAO_Contact',
928 'localizable' => 0,
929 'html' => [
930 'type' => 'Select',
931 ],
932 'pseudoconstant' => [
933 'optionGroupName' => 'individual_suffix',
934 'optionEditPath' => 'civicrm/admin/options/individual_suffix',
935 ],
936 ],
937 'formal_title' => [
938 'name' => 'formal_title',
939 'type' => CRM_Utils_Type::T_STRING,
940 'title' => ts('Formal Title'),
941 'description' => ts('Formal (academic or similar) title in front of name. (Prof., Dr. etc.)'),
942 'maxlength' => 64,
943 'size' => CRM_Utils_Type::BIG,
944 'import' => TRUE,
945 'where' => 'civicrm_contact.formal_title',
946 'headerPattern' => '/^title/i',
947 'export' => TRUE,
948 'table_name' => 'civicrm_contact',
949 'entity' => 'Contact',
950 'bao' => 'CRM_Contact_BAO_Contact',
951 'localizable' => 0,
952 'html' => [
953 'type' => 'Text',
954 ],
955 ],
956 'communication_style_id' => [
957 'name' => 'communication_style_id',
958 'type' => CRM_Utils_Type::T_INT,
959 'title' => ts('Communication Style'),
960 'description' => ts('Communication style (e.g. formal vs. familiar) to use with this contact. FK to communication styles in civicrm_option_value.'),
961 'where' => 'civicrm_contact.communication_style_id',
962 'export' => TRUE,
963 'table_name' => 'civicrm_contact',
964 'entity' => 'Contact',
965 'bao' => 'CRM_Contact_BAO_Contact',
966 'localizable' => 0,
967 'html' => [
968 'type' => 'Select',
969 ],
970 'pseudoconstant' => [
971 'optionGroupName' => 'communication_style',
972 'optionEditPath' => 'civicrm/admin/options/communication_style',
973 ],
974 ],
975 'email_greeting_id' => [
976 'name' => 'email_greeting_id',
977 'type' => CRM_Utils_Type::T_INT,
978 'title' => ts('Email Greeting ID'),
979 'description' => ts('FK to civicrm_option_value.id, that has to be valid registered Email Greeting.'),
980 'where' => 'civicrm_contact.email_greeting_id',
981 'export' => TRUE,
982 'table_name' => 'civicrm_contact',
983 'entity' => 'Contact',
984 'bao' => 'CRM_Contact_BAO_Contact',
985 'localizable' => 0,
986 'pseudoconstant' => [
987 'optionGroupName' => 'email_greeting',
988 'optionEditPath' => 'civicrm/admin/options/email_greeting',
989 ],
990 ],
991 'email_greeting_custom' => [
992 'name' => 'email_greeting_custom',
993 'type' => CRM_Utils_Type::T_STRING,
994 'title' => ts('Email Greeting Custom'),
995 'description' => ts('Custom Email Greeting.'),
996 'maxlength' => 128,
997 'size' => CRM_Utils_Type::HUGE,
998 'import' => TRUE,
999 'where' => 'civicrm_contact.email_greeting_custom',
1000 'export' => FALSE,
1001 'table_name' => 'civicrm_contact',
1002 'entity' => 'Contact',
1003 'bao' => 'CRM_Contact_BAO_Contact',
1004 'localizable' => 0,
1005 'html' => [
1006 'type' => 'Text',
1007 ],
1008 ],
1009 'email_greeting_display' => [
1010 'name' => 'email_greeting_display',
1011 'type' => CRM_Utils_Type::T_STRING,
1012 'title' => ts('Email Greeting'),
1013 'description' => ts('Cache Email Greeting.'),
1014 'maxlength' => 255,
1015 'size' => CRM_Utils_Type::HUGE,
1016 'where' => 'civicrm_contact.email_greeting_display',
1017 'table_name' => 'civicrm_contact',
1018 'entity' => 'Contact',
1019 'bao' => 'CRM_Contact_BAO_Contact',
1020 'localizable' => 0,
1021 'html' => [
1022 'type' => 'Text',
1023 ],
1024 ],
1025 'postal_greeting_id' => [
1026 'name' => 'postal_greeting_id',
1027 'type' => CRM_Utils_Type::T_INT,
1028 'title' => ts('Postal Greeting ID'),
1029 'description' => ts('FK to civicrm_option_value.id, that has to be valid registered Postal Greeting.'),
1030 'where' => 'civicrm_contact.postal_greeting_id',
1031 'export' => TRUE,
1032 'table_name' => 'civicrm_contact',
1033 'entity' => 'Contact',
1034 'bao' => 'CRM_Contact_BAO_Contact',
1035 'localizable' => 0,
1036 'html' => [
1037 'type' => 'Text',
1038 ],
1039 'pseudoconstant' => [
1040 'optionGroupName' => 'postal_greeting',
1041 'optionEditPath' => 'civicrm/admin/options/postal_greeting',
1042 ],
1043 ],
1044 'postal_greeting_custom' => [
1045 'name' => 'postal_greeting_custom',
1046 'type' => CRM_Utils_Type::T_STRING,
1047 'title' => ts('Postal Greeting Custom'),
1048 'description' => ts('Custom Postal greeting.'),
1049 'maxlength' => 128,
1050 'size' => CRM_Utils_Type::HUGE,
1051 'import' => TRUE,
1052 'where' => 'civicrm_contact.postal_greeting_custom',
1053 'export' => FALSE,
1054 'table_name' => 'civicrm_contact',
1055 'entity' => 'Contact',
1056 'bao' => 'CRM_Contact_BAO_Contact',
1057 'localizable' => 0,
1058 'html' => [
1059 'type' => 'Text',
1060 ],
1061 ],
1062 'postal_greeting_display' => [
1063 'name' => 'postal_greeting_display',
1064 'type' => CRM_Utils_Type::T_STRING,
1065 'title' => ts('Postal Greeting'),
1066 'description' => ts('Cache Postal greeting.'),
1067 'maxlength' => 255,
1068 'size' => CRM_Utils_Type::HUGE,
1069 'where' => 'civicrm_contact.postal_greeting_display',
1070 'table_name' => 'civicrm_contact',
1071 'entity' => 'Contact',
1072 'bao' => 'CRM_Contact_BAO_Contact',
1073 'localizable' => 0,
1074 'html' => [
1075 'type' => 'Text',
1076 ],
1077 ],
1078 'addressee_id' => [
1079 'name' => 'addressee_id',
1080 'type' => CRM_Utils_Type::T_INT,
1081 'title' => ts('Addressee ID'),
1082 'description' => ts('FK to civicrm_option_value.id, that has to be valid registered Addressee.'),
1083 'where' => 'civicrm_contact.addressee_id',
1084 'export' => TRUE,
1085 'table_name' => 'civicrm_contact',
1086 'entity' => 'Contact',
1087 'bao' => 'CRM_Contact_BAO_Contact',
1088 'localizable' => 0,
1089 'pseudoconstant' => [
1090 'optionGroupName' => 'addressee',
1091 'optionEditPath' => 'civicrm/admin/options/addressee',
1092 ],
1093 ],
1094 'addressee_custom' => [
1095 'name' => 'addressee_custom',
1096 'type' => CRM_Utils_Type::T_STRING,
1097 'title' => ts('Addressee Custom'),
1098 'description' => ts('Custom Addressee.'),
1099 'maxlength' => 128,
1100 'size' => CRM_Utils_Type::HUGE,
1101 'import' => TRUE,
1102 'where' => 'civicrm_contact.addressee_custom',
1103 'export' => FALSE,
1104 'table_name' => 'civicrm_contact',
1105 'entity' => 'Contact',
1106 'bao' => 'CRM_Contact_BAO_Contact',
1107 'localizable' => 0,
1108 'html' => [
1109 'type' => 'Text',
1110 ],
1111 ],
1112 'addressee_display' => [
1113 'name' => 'addressee_display',
1114 'type' => CRM_Utils_Type::T_STRING,
1115 'title' => ts('Addressee'),
1116 'description' => ts('Cache Addressee.'),
1117 'maxlength' => 255,
1118 'size' => CRM_Utils_Type::HUGE,
1119 'where' => 'civicrm_contact.addressee_display',
1120 'table_name' => 'civicrm_contact',
1121 'entity' => 'Contact',
1122 'bao' => 'CRM_Contact_BAO_Contact',
1123 'localizable' => 0,
1124 'html' => [
1125 'type' => 'Text',
1126 ],
1127 ],
1128 'job_title' => [
1129 'name' => 'job_title',
1130 'type' => CRM_Utils_Type::T_STRING,
1131 'title' => ts('Job Title'),
1132 'description' => ts('Job Title'),
1133 'maxlength' => 255,
1134 'size' => 30,
1135 'import' => TRUE,
1136 'where' => 'civicrm_contact.job_title',
1137 'headerPattern' => '/^job|(j(ob\s)?title)$/i',
1138 'dataPattern' => '//',
1139 'export' => TRUE,
1140 'table_name' => 'civicrm_contact',
1141 'entity' => 'Contact',
1142 'bao' => 'CRM_Contact_BAO_Contact',
1143 'localizable' => 0,
1144 'html' => [
1145 'type' => 'Text',
1146 ],
1147 ],
1148 'gender_id' => [
1149 'name' => 'gender_id',
1150 'type' => CRM_Utils_Type::T_INT,
1151 'title' => ts('Gender'),
1152 'description' => ts('FK to gender ID'),
1153 'import' => TRUE,
1154 'where' => 'civicrm_contact.gender_id',
1155 'headerPattern' => '/^gender$/i',
1156 'export' => TRUE,
1157 'table_name' => 'civicrm_contact',
1158 'entity' => 'Contact',
1159 'bao' => 'CRM_Contact_BAO_Contact',
1160 'localizable' => 0,
1161 'html' => [
1162 'type' => 'Select',
1163 ],
1164 'pseudoconstant' => [
1165 'optionGroupName' => 'gender',
1166 'optionEditPath' => 'civicrm/admin/options/gender',
1167 ],
1168 ],
1169 'birth_date' => [
1170 'name' => 'birth_date',
1171 'type' => CRM_Utils_Type::T_DATE,
1172 'title' => ts('Birth Date'),
1173 'description' => ts('Date of birth'),
1174 'import' => TRUE,
1175 'where' => 'civicrm_contact.birth_date',
1176 'headerPattern' => '/^birth|(b(irth\s)?date)|D(\W*)O(\W*)B(\W*)$/i',
1177 'dataPattern' => '/\d{4}-?\d{2}-?\d{2}/',
1178 'export' => TRUE,
1179 'table_name' => 'civicrm_contact',
1180 'entity' => 'Contact',
1181 'bao' => 'CRM_Contact_BAO_Contact',
1182 'localizable' => 0,
1183 'html' => [
1184 'type' => 'Select Date',
1185 'formatType' => 'birth',
1186 ],
1187 ],
1188 'is_deceased' => [
1189 'name' => 'is_deceased',
1190 'type' => CRM_Utils_Type::T_BOOLEAN,
1191 'title' => ts('Deceased'),
1192 'import' => TRUE,
1193 'where' => 'civicrm_contact.is_deceased',
1194 'headerPattern' => '/i(s\s)?d(eceased)$/i',
1195 'export' => TRUE,
1196 'default' => '0',
1197 'table_name' => 'civicrm_contact',
1198 'entity' => 'Contact',
1199 'bao' => 'CRM_Contact_BAO_Contact',
1200 'localizable' => 0,
1201 'html' => [
1202 'type' => 'CheckBox',
1203 ],
1204 ],
1205 'deceased_date' => [
1206 'name' => 'deceased_date',
1207 'type' => CRM_Utils_Type::T_DATE,
1208 'title' => ts('Deceased Date'),
1209 'description' => ts('Date of deceased'),
1210 'import' => TRUE,
1211 'where' => 'civicrm_contact.deceased_date',
1212 'headerPattern' => '/^deceased|(d(eceased\s)?date)$/i',
1213 'export' => TRUE,
1214 'table_name' => 'civicrm_contact',
1215 'entity' => 'Contact',
1216 'bao' => 'CRM_Contact_BAO_Contact',
1217 'localizable' => 0,
1218 'html' => [
1219 'type' => 'Select Date',
1220 'formatType' => 'birth',
1221 ],
1222 ],
1223 'household_name' => [
1224 'name' => 'household_name',
1225 'type' => CRM_Utils_Type::T_STRING,
1226 'title' => ts('Household Name'),
1227 'description' => ts('Household Name.'),
1228 'maxlength' => 128,
1229 'size' => 30,
1230 'import' => TRUE,
1231 'where' => 'civicrm_contact.household_name',
1232 'headerPattern' => '/^household|(h(ousehold\s)?name)$/i',
1233 'dataPattern' => '/^\w+$/',
1234 'export' => TRUE,
1235 'table_name' => 'civicrm_contact',
1236 'entity' => 'Contact',
1237 'bao' => 'CRM_Contact_BAO_Contact',
1238 'localizable' => 0,
1239 'html' => [
1240 'type' => 'Text',
1241 ],
1242 ],
1243 'primary_contact_id' => [
1244 'name' => 'primary_contact_id',
1245 'type' => CRM_Utils_Type::T_INT,
1246 'title' => ts('Household Primary Contact ID'),
1247 'description' => ts('Optional FK to Primary Contact for this household.'),
1248 'where' => 'civicrm_contact.primary_contact_id',
1249 'table_name' => 'civicrm_contact',
1250 'entity' => 'Contact',
1251 'bao' => 'CRM_Contact_BAO_Contact',
1252 'localizable' => 0,
1253 'FKClassName' => 'CRM_Contact_DAO_Contact',
1254 'html' => [
1255 'type' => 'Select',
1256 ],
1257 ],
1258 'organization_name' => [
1259 'name' => 'organization_name',
1260 'type' => CRM_Utils_Type::T_STRING,
1261 'title' => ts('Organization Name'),
1262 'description' => ts('Organization Name.'),
1263 'maxlength' => 128,
1264 'size' => 30,
1265 'import' => TRUE,
1266 'where' => 'civicrm_contact.organization_name',
1267 'headerPattern' => '/^organization|(o(rganization\s)?name)$/i',
1268 'dataPattern' => '/^\w+$/',
1269 'export' => TRUE,
1270 'table_name' => 'civicrm_contact',
1271 'entity' => 'Contact',
1272 'bao' => 'CRM_Contact_BAO_Contact',
1273 'localizable' => 0,
1274 'html' => [
1275 'type' => 'Text',
1276 ],
1277 ],
1278 'sic_code' => [
1279 'name' => 'sic_code',
1280 'type' => CRM_Utils_Type::T_STRING,
1281 'title' => ts('Sic Code'),
1282 'description' => ts('Standard Industry Classification Code.'),
1283 'maxlength' => 8,
1284 'size' => CRM_Utils_Type::EIGHT,
1285 'import' => TRUE,
1286 'where' => 'civicrm_contact.sic_code',
1287 'headerPattern' => '/^sic|(s(ic\s)?code)$/i',
1288 'export' => TRUE,
1289 'table_name' => 'civicrm_contact',
1290 'entity' => 'Contact',
1291 'bao' => 'CRM_Contact_BAO_Contact',
1292 'localizable' => 0,
1293 'html' => [
1294 'type' => 'Text',
1295 ],
1296 ],
1297 'user_unique_id' => [
1298 'name' => 'user_unique_id',
1299 'type' => CRM_Utils_Type::T_STRING,
1300 'title' => ts('Unique ID (OpenID)'),
1301 'description' => ts('the OpenID (or OpenID-style http://username.domain/) unique identifier for this contact mainly used for logging in to CiviCRM'),
1302 'maxlength' => 255,
1303 'size' => CRM_Utils_Type::HUGE,
1304 'import' => TRUE,
1305 'where' => 'civicrm_contact.user_unique_id',
1306 'headerPattern' => '/^Open\s?ID|u(niq\w*)?\s?ID/i',
1307 'dataPattern' => '/^[\w\/\:\.]+$/',
1308 'export' => TRUE,
1309 'rule' => 'url',
1310 'table_name' => 'civicrm_contact',
1311 'entity' => 'Contact',
1312 'bao' => 'CRM_Contact_BAO_Contact',
1313 'localizable' => 0,
1314 'html' => [
1315 'type' => 'Text',
1316 ],
1317 ],
1318 'current_employer_id' => [
1319 'name' => 'employer_id',
1320 'type' => CRM_Utils_Type::T_INT,
1321 'title' => ts('Current Employer'),
1322 'description' => ts('OPTIONAL FK to civicrm_contact record.'),
1323 'where' => 'civicrm_contact.employer_id',
1324 'export' => TRUE,
1325 'table_name' => 'civicrm_contact',
1326 'entity' => 'Contact',
1327 'bao' => 'CRM_Contact_BAO_Contact',
1328 'localizable' => 0,
1329 'FKClassName' => 'CRM_Contact_DAO_Contact',
1330 'html' => [
1331 'type' => 'EntityRef',
1332 ],
1333 ],
1334 'contact_is_deleted' => [
1335 'name' => 'is_deleted',
1336 'type' => CRM_Utils_Type::T_BOOLEAN,
1337 'title' => ts('Contact is in Trash'),
1338 'required' => TRUE,
1339 'where' => 'civicrm_contact.is_deleted',
1340 'export' => TRUE,
1341 'default' => '0',
1342 'table_name' => 'civicrm_contact',
1343 'entity' => 'Contact',
1344 'bao' => 'CRM_Contact_BAO_Contact',
1345 'localizable' => 0,
1346 'html' => [
1347 'type' => 'CheckBox',
1348 ],
1349 ],
1350 'created_date' => [
1351 'name' => 'created_date',
1352 'type' => CRM_Utils_Type::T_TIMESTAMP,
1353 'title' => ts('Created Date'),
1354 'description' => ts('When was the contact was created.'),
1355 'required' => FALSE,
1356 'where' => 'civicrm_contact.created_date',
1357 'export' => TRUE,
1358 'default' => 'NULL',
1359 'table_name' => 'civicrm_contact',
1360 'entity' => 'Contact',
1361 'bao' => 'CRM_Contact_BAO_Contact',
1362 'localizable' => 0,
1363 ],
1364 'modified_date' => [
1365 'name' => 'modified_date',
1366 'type' => CRM_Utils_Type::T_TIMESTAMP,
1367 'title' => ts('Modified Date'),
1368 'description' => ts('When was the contact (or closely related entity) was created or modified or deleted.'),
1369 'required' => FALSE,
1370 'where' => 'civicrm_contact.modified_date',
1371 'export' => TRUE,
1372 'default' => 'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP',
1373 'table_name' => 'civicrm_contact',
1374 'entity' => 'Contact',
1375 'bao' => 'CRM_Contact_BAO_Contact',
1376 'localizable' => 0,
1377 ],
1378 ];
1379 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
1380 }
1381 return Civi::$statics[__CLASS__]['fields'];
1382 }
1383
1384 /**
1385 * Return a mapping from field-name to the corresponding key (as used in fields()).
1386 *
1387 * @return array
1388 * Array(string $name => string $uniqueName).
1389 */
1390 public static function &fieldKeys() {
1391 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
1392 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
1393 }
1394 return Civi::$statics[__CLASS__]['fieldKeys'];
1395 }
1396
1397 /**
1398 * Returns the names of this table
1399 *
1400 * @return string
1401 */
1402 public static function getTableName() {
1403 return self::$_tableName;
1404 }
1405
1406 /**
1407 * Returns if this table needs to be logged
1408 *
1409 * @return bool
1410 */
1411 public function getLog() {
1412 return self::$_log;
1413 }
1414
1415 /**
1416 * Returns the list of fields that can be imported
1417 *
1418 * @param bool $prefix
1419 *
1420 * @return array
1421 */
1422 public static function &import($prefix = FALSE) {
1423 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'contact', $prefix, []);
1424 return $r;
1425 }
1426
1427 /**
1428 * Returns the list of fields that can be exported
1429 *
1430 * @param bool $prefix
1431 *
1432 * @return array
1433 */
1434 public static function &export($prefix = FALSE) {
1435 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'contact', $prefix, []);
1436 return $r;
1437 }
1438
1439 /**
1440 * Returns the list of indices
1441 *
1442 * @param bool $localize
1443 *
1444 * @return array
1445 */
1446 public static function indices($localize = TRUE) {
1447 $indices = [
1448 'index_contact_type' => [
1449 'name' => 'index_contact_type',
1450 'field' => [
1451 0 => 'contact_type',
1452 ],
1453 'localizable' => FALSE,
1454 'sig' => 'civicrm_contact::0::contact_type',
1455 ],
1456 'index_contact_sub_type' => [
1457 'name' => 'index_contact_sub_type',
1458 'field' => [
1459 0 => 'contact_sub_type',
1460 ],
1461 'localizable' => FALSE,
1462 'sig' => 'civicrm_contact::0::contact_sub_type',
1463 ],
1464 'UI_external_identifier' => [
1465 'name' => 'UI_external_identifier',
1466 'field' => [
1467 0 => 'external_identifier',
1468 ],
1469 'localizable' => FALSE,
1470 'unique' => TRUE,
1471 'sig' => 'civicrm_contact::1::external_identifier',
1472 ],
1473 'index_sort_name' => [
1474 'name' => 'index_sort_name',
1475 'field' => [
1476 0 => 'sort_name',
1477 ],
1478 'localizable' => FALSE,
1479 'sig' => 'civicrm_contact::0::sort_name',
1480 ],
1481 'index_preferred_communication_method' => [
1482 'name' => 'index_preferred_communication_method',
1483 'field' => [
1484 0 => 'preferred_communication_method',
1485 ],
1486 'localizable' => FALSE,
1487 'sig' => 'civicrm_contact::0::preferred_communication_method',
1488 ],
1489 'index_hash' => [
1490 'name' => 'index_hash',
1491 'field' => [
1492 0 => 'hash',
1493 ],
1494 'localizable' => FALSE,
1495 'sig' => 'civicrm_contact::0::hash',
1496 ],
1497 'index_api_key' => [
1498 'name' => 'index_api_key',
1499 'field' => [
1500 0 => 'api_key',
1501 ],
1502 'localizable' => FALSE,
1503 'sig' => 'civicrm_contact::0::api_key',
1504 ],
1505 'index_first_name' => [
1506 'name' => 'index_first_name',
1507 'field' => [
1508 0 => 'first_name',
1509 ],
1510 'localizable' => FALSE,
1511 'sig' => 'civicrm_contact::0::first_name',
1512 ],
1513 'index_last_name' => [
1514 'name' => 'index_last_name',
1515 'field' => [
1516 0 => 'last_name',
1517 ],
1518 'localizable' => FALSE,
1519 'sig' => 'civicrm_contact::0::last_name',
1520 ],
1521 'UI_prefix' => [
1522 'name' => 'UI_prefix',
1523 'field' => [
1524 0 => 'prefix_id',
1525 ],
1526 'localizable' => FALSE,
1527 'sig' => 'civicrm_contact::0::prefix_id',
1528 ],
1529 'UI_suffix' => [
1530 'name' => 'UI_suffix',
1531 'field' => [
1532 0 => 'suffix_id',
1533 ],
1534 'localizable' => FALSE,
1535 'sig' => 'civicrm_contact::0::suffix_id',
1536 ],
1537 'index_communication_style_id' => [
1538 'name' => 'index_communication_style_id',
1539 'field' => [
1540 0 => 'communication_style_id',
1541 ],
1542 'localizable' => FALSE,
1543 'sig' => 'civicrm_contact::0::communication_style_id',
1544 ],
1545 'UI_gender' => [
1546 'name' => 'UI_gender',
1547 'field' => [
1548 0 => 'gender_id',
1549 ],
1550 'localizable' => FALSE,
1551 'sig' => 'civicrm_contact::0::gender_id',
1552 ],
1553 'index_is_deceased' => [
1554 'name' => 'index_is_deceased',
1555 'field' => [
1556 0 => 'is_deceased',
1557 ],
1558 'localizable' => FALSE,
1559 'sig' => 'civicrm_contact::0::is_deceased',
1560 ],
1561 'index_household_name' => [
1562 'name' => 'index_household_name',
1563 'field' => [
1564 0 => 'household_name',
1565 ],
1566 'localizable' => FALSE,
1567 'sig' => 'civicrm_contact::0::household_name',
1568 ],
1569 'index_organization_name' => [
1570 'name' => 'index_organization_name',
1571 'field' => [
1572 0 => 'organization_name',
1573 ],
1574 'localizable' => FALSE,
1575 'sig' => 'civicrm_contact::0::organization_name',
1576 ],
1577 'index_is_deleted_sort_name' => [
1578 'name' => 'index_is_deleted_sort_name',
1579 'field' => [
1580 0 => 'is_deleted',
1581 1 => 'sort_name',
1582 2 => 'id',
1583 ],
1584 'localizable' => FALSE,
1585 'sig' => 'civicrm_contact::0::is_deleted::sort_name::id',
1586 ],
1587 ];
1588 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
1589 }
1590
1591 }