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