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