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