Merge pull request #22161 from eileenmcnaughton/pay_test2
[civicrm-core.git] / CRM / Core / DAO / MailSettings.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/Core/MailSettings.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
2562d09a 9 * (GenCodeChecksum:116c87968f4c16758eff8825047a6ceb)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the MailSettings entity.
f41f0342 14 */
e501603b 15class CRM_Core_DAO_MailSettings extends CRM_Core_DAO {
929a1c14
CW
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '2.2';
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_mail_settings';
c3fc2621 25
e501603b 26 /**
f41f0342 27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
e501603b 28 *
c3fc2621 29 * @var bool
e501603b 30 */
fa45b5b9 31 public static $_log = FALSE;
c3fc2621 32
e501603b
TO
33 /**
34 * primary key
35 *
e6ca0a57 36 * @var int
e501603b
TO
37 */
38 public $id;
c3fc2621 39
e501603b
TO
40 /**
41 * Which Domain is this match entry for
42 *
e6ca0a57 43 * @var int
e501603b
TO
44 */
45 public $domain_id;
c3fc2621 46
e501603b
TO
47 /**
48 * name of this group of settings
49 *
50 * @var string
51 */
52 public $name;
c3fc2621 53
e501603b
TO
54 /**
55 * whether this is the default set of settings for this domain
56 *
e6ca0a57 57 * @var bool
e501603b
TO
58 */
59 public $is_default;
c3fc2621 60
e501603b
TO
61 /**
62 * email address domain (the part after @)
63 *
64 * @var string
65 */
66 public $domain;
c3fc2621 67
e501603b
TO
68 /**
69 * optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)
70 *
71 * @var string
72 */
73 public $localpart;
c3fc2621 74
e501603b
TO
75 /**
76 * contents of the Return-Path header
77 *
78 * @var string
79 */
80 public $return_path;
c3fc2621 81
e501603b
TO
82 /**
83 * name of the protocol to use for polling (like IMAP, POP3 or Maildir)
84 *
85 * @var string
86 */
87 public $protocol;
c3fc2621 88
e501603b
TO
89 /**
90 * server to use when polling
91 *
92 * @var string
93 */
94 public $server;
c3fc2621 95
e501603b
TO
96 /**
97 * port to use when polling
98 *
e6ca0a57 99 * @var int
e501603b
TO
100 */
101 public $port;
c3fc2621 102
e501603b
TO
103 /**
104 * username to use when polling
105 *
106 * @var string
107 */
108 public $username;
c3fc2621 109
e501603b
TO
110 /**
111 * password to use when polling
112 *
113 * @var string
114 */
115 public $password;
c3fc2621 116
e501603b
TO
117 /**
118 * whether to use SSL or not
119 *
e6ca0a57 120 * @var bool
e501603b
TO
121 */
122 public $is_ssl;
c3fc2621 123
e501603b
TO
124 /**
125 * folder to poll from when using IMAP, path to poll from when using Maildir, etc.
126 *
127 * @var string
128 */
129 public $source;
c3fc2621 130
040073c9
CW
131 /**
132 * Name of status to use when creating email to activity.
133 *
134 * @var string
135 */
136 public $activity_status;
c3fc2621 137
2f0fd07c
SL
138 /**
139 * Enabling this option will have CiviCRM skip any emails that do not have the Case ID or Case Hash so that the system will only process emails that can be placed on case records. Any emails that are not processed will be moved to the ignored folder.
140 *
141 * @var bool
142 */
143 public $is_non_case_email_skipped;
144
145 /**
146 * @var bool
147 */
148 public $is_contact_creation_disabled_if_no_match;
149
e501603b 150 /**
f41f0342 151 * Class constructor.
e501603b 152 */
c3fc2621 153 public function __construct() {
e501603b
TO
154 $this->__table = 'civicrm_mail_settings';
155 parent::__construct();
156 }
c3fc2621 157
449c4e6b
CW
158 /**
159 * Returns localized title of this entity.
7b66c3b5
AH
160 *
161 * @param bool $plural
162 * Whether to return the plural version of the title.
449c4e6b 163 */
7b66c3b5
AH
164 public static function getEntityTitle($plural = FALSE) {
165 return $plural ? ts('Mail Settingses') : ts('Mail Settings');
449c4e6b
CW
166 }
167
e501603b 168 /**
f41f0342 169 * Returns foreign keys and entity references.
e501603b
TO
170 *
171 * @return array
172 * [CRM_Core_Reference_Interface]
173 */
c3fc2621 174 public static function getReferenceColumns() {
346aaaba 175 if (!isset(Civi::$statics[__CLASS__]['links'])) {
fa45b5b9 176 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
c3fc2621 177 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'domain_id', 'civicrm_domain', 'id');
346aaaba 178 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 179 }
346aaaba 180 return Civi::$statics[__CLASS__]['links'];
e501603b 181 }
c3fc2621 182
e501603b
TO
183 /**
184 * Returns all the column names of this table
185 *
186 * @return array
187 */
c3fc2621 188 public static function &fields() {
346aaaba 189 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
190 Civi::$statics[__CLASS__]['fields'] = [
191 'id' => [
e501603b
TO
192 'name' => 'id',
193 'type' => CRM_Utils_Type::T_INT,
c3fc2621 194 'title' => ts('Mail Settings ID'),
215b423e 195 'description' => ts('primary key'),
c3fc2621 196 'required' => TRUE,
a36434b9 197 'where' => 'civicrm_mail_settings.id',
522a26c9 198 'table_name' => 'civicrm_mail_settings',
199 'entity' => 'MailSettings',
200 'bao' => 'CRM_Core_BAO_MailSettings',
6a7e5e5d 201 'localizable' => 0,
2cbbebe8
A
202 'html' => [
203 'type' => 'Number',
204 ],
1fe423d6 205 'readonly' => TRUE,
a9d0587b 206 'add' => '2.2',
c3fc2621
CW
207 ],
208 'domain_id' => [
e501603b
TO
209 'name' => 'domain_id',
210 'type' => CRM_Utils_Type::T_INT,
2cbbebe8 211 'title' => ts('Domain ID'),
215b423e 212 'description' => ts('Which Domain is this match entry for'),
c3fc2621 213 'required' => TRUE,
a36434b9 214 'where' => 'civicrm_mail_settings.domain_id',
522a26c9 215 'table_name' => 'civicrm_mail_settings',
216 'entity' => 'MailSettings',
217 'bao' => 'CRM_Core_BAO_MailSettings',
6a7e5e5d 218 'localizable' => 0,
e501603b 219 'FKClassName' => 'CRM_Core_DAO_Domain',
2cbbebe8
A
220 'html' => [
221 'label' => ts("Domain"),
222 ],
c3fc2621 223 'pseudoconstant' => [
e501603b
TO
224 'table' => 'civicrm_domain',
225 'keyColumn' => 'id',
226 'labelColumn' => 'name',
e6ca0a57 227 ],
a9d0587b 228 'add' => '3.1',
c3fc2621
CW
229 ],
230 'name' => [
e501603b
TO
231 'name' => 'name',
232 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 233 'title' => ts('Mail Settings Name'),
215b423e 234 'description' => ts('name of this group of settings'),
e501603b
TO
235 'maxlength' => 255,
236 'size' => CRM_Utils_Type::HUGE,
a36434b9 237 'where' => 'civicrm_mail_settings.name',
522a26c9 238 'table_name' => 'civicrm_mail_settings',
239 'entity' => 'MailSettings',
240 'bao' => 'CRM_Core_BAO_MailSettings',
6a7e5e5d 241 'localizable' => 0,
a9d0587b 242 'add' => '2.2',
c3fc2621
CW
243 ],
244 'is_default' => [
e501603b
TO
245 'name' => 'is_default',
246 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 247 'title' => ts('Is Default Mail Settings?'),
215b423e 248 'description' => ts('whether this is the default set of settings for this domain'),
a36434b9 249 'where' => 'civicrm_mail_settings.is_default',
522a26c9 250 'table_name' => 'civicrm_mail_settings',
251 'entity' => 'MailSettings',
252 'bao' => 'CRM_Core_BAO_MailSettings',
6a7e5e5d 253 'localizable' => 0,
a9d0587b 254 'add' => '2.2',
c3fc2621
CW
255 ],
256 'domain' => [
e501603b
TO
257 'name' => 'domain',
258 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 259 'title' => ts('email Domain'),
215b423e 260 'description' => ts('email address domain (the part after @)'),
e501603b
TO
261 'maxlength' => 255,
262 'size' => CRM_Utils_Type::HUGE,
a36434b9 263 'where' => 'civicrm_mail_settings.domain',
522a26c9 264 'table_name' => 'civicrm_mail_settings',
265 'entity' => 'MailSettings',
266 'bao' => 'CRM_Core_BAO_MailSettings',
6a7e5e5d 267 'localizable' => 0,
a9d0587b 268 'add' => '2.2',
c3fc2621
CW
269 ],
270 'localpart' => [
e501603b
TO
271 'name' => 'localpart',
272 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 273 'title' => ts('email Local Part'),
215b423e 274 'description' => ts('optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)'),
e501603b
TO
275 'maxlength' => 255,
276 'size' => CRM_Utils_Type::HUGE,
a36434b9 277 'where' => 'civicrm_mail_settings.localpart',
522a26c9 278 'table_name' => 'civicrm_mail_settings',
279 'entity' => 'MailSettings',
280 'bao' => 'CRM_Core_BAO_MailSettings',
6a7e5e5d 281 'localizable' => 0,
a9d0587b 282 'add' => '2.2',
c3fc2621
CW
283 ],
284 'return_path' => [
e501603b
TO
285 'name' => 'return_path',
286 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 287 'title' => ts('Return Path'),
215b423e 288 'description' => ts('contents of the Return-Path header'),
e501603b
TO
289 'maxlength' => 255,
290 'size' => CRM_Utils_Type::HUGE,
a36434b9 291 'where' => 'civicrm_mail_settings.return_path',
522a26c9 292 'table_name' => 'civicrm_mail_settings',
293 'entity' => 'MailSettings',
294 'bao' => 'CRM_Core_BAO_MailSettings',
6a7e5e5d 295 'localizable' => 0,
a9d0587b 296 'add' => '2.2',
c3fc2621
CW
297 ],
298 'protocol' => [
e501603b
TO
299 'name' => 'protocol',
300 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 301 'title' => ts('Protocol'),
215b423e 302 'description' => ts('name of the protocol to use for polling (like IMAP, POP3 or Maildir)'),
e501603b
TO
303 'maxlength' => 255,
304 'size' => CRM_Utils_Type::HUGE,
a36434b9 305 'where' => 'civicrm_mail_settings.protocol',
522a26c9 306 'table_name' => 'civicrm_mail_settings',
307 'entity' => 'MailSettings',
308 'bao' => 'CRM_Core_BAO_MailSettings',
6a7e5e5d 309 'localizable' => 0,
c3fc2621 310 'html' => [
e501603b 311 'type' => 'Select',
c3fc2621
CW
312 ],
313 'pseudoconstant' => [
e501603b
TO
314 'optionGroupName' => 'mail_protocol',
315 'optionEditPath' => 'civicrm/admin/options/mail_protocol',
e6ca0a57 316 ],
a9d0587b 317 'add' => '2.2',
c3fc2621
CW
318 ],
319 'server' => [
e501603b
TO
320 'name' => 'server',
321 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 322 'title' => ts('Mail Server'),
215b423e 323 'description' => ts('server to use when polling'),
e501603b
TO
324 'maxlength' => 255,
325 'size' => CRM_Utils_Type::HUGE,
a36434b9 326 'where' => 'civicrm_mail_settings.server',
522a26c9 327 'table_name' => 'civicrm_mail_settings',
328 'entity' => 'MailSettings',
329 'bao' => 'CRM_Core_BAO_MailSettings',
6a7e5e5d 330 'localizable' => 0,
a9d0587b 331 'add' => '2.2',
c3fc2621
CW
332 ],
333 'port' => [
e501603b
TO
334 'name' => 'port',
335 'type' => CRM_Utils_Type::T_INT,
c3fc2621 336 'title' => ts('Mail Port'),
215b423e 337 'description' => ts('port to use when polling'),
a36434b9 338 'where' => 'civicrm_mail_settings.port',
522a26c9 339 'table_name' => 'civicrm_mail_settings',
340 'entity' => 'MailSettings',
341 'bao' => 'CRM_Core_BAO_MailSettings',
6a7e5e5d 342 'localizable' => 0,
a9d0587b 343 'add' => '2.2',
c3fc2621
CW
344 ],
345 'username' => [
e501603b
TO
346 'name' => 'username',
347 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 348 'title' => ts('Mail Account Username'),
215b423e 349 'description' => ts('username to use when polling'),
e501603b
TO
350 'maxlength' => 255,
351 'size' => CRM_Utils_Type::HUGE,
a36434b9 352 'where' => 'civicrm_mail_settings.username',
522a26c9 353 'table_name' => 'civicrm_mail_settings',
354 'entity' => 'MailSettings',
355 'bao' => 'CRM_Core_BAO_MailSettings',
6a7e5e5d 356 'localizable' => 0,
a9d0587b 357 'add' => '2.2',
c3fc2621
CW
358 ],
359 'password' => [
e501603b
TO
360 'name' => 'password',
361 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 362 'title' => ts('Mail Account Password'),
215b423e 363 'description' => ts('password to use when polling'),
e501603b
TO
364 'maxlength' => 255,
365 'size' => CRM_Utils_Type::HUGE,
a36434b9 366 'where' => 'civicrm_mail_settings.password',
522a26c9 367 'table_name' => 'civicrm_mail_settings',
368 'entity' => 'MailSettings',
369 'bao' => 'CRM_Core_BAO_MailSettings',
6a7e5e5d 370 'localizable' => 0,
a9d0587b 371 'add' => '2.2',
c3fc2621
CW
372 ],
373 'is_ssl' => [
e501603b
TO
374 'name' => 'is_ssl',
375 'type' => CRM_Utils_Type::T_BOOLEAN,
c3fc2621 376 'title' => ts('Mail Account Uses SSL'),
215b423e 377 'description' => ts('whether to use SSL or not'),
a36434b9 378 'where' => 'civicrm_mail_settings.is_ssl',
522a26c9 379 'table_name' => 'civicrm_mail_settings',
380 'entity' => 'MailSettings',
381 'bao' => 'CRM_Core_BAO_MailSettings',
6a7e5e5d 382 'localizable' => 0,
a9d0587b 383 'add' => '2.2',
c3fc2621
CW
384 ],
385 'source' => [
e501603b
TO
386 'name' => 'source',
387 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 388 'title' => ts('Mail Folder'),
215b423e 389 'description' => ts('folder to poll from when using IMAP, path to poll from when using Maildir, etc.'),
e501603b
TO
390 'maxlength' => 255,
391 'size' => CRM_Utils_Type::HUGE,
a36434b9 392 'where' => 'civicrm_mail_settings.source',
522a26c9 393 'table_name' => 'civicrm_mail_settings',
394 'entity' => 'MailSettings',
395 'bao' => 'CRM_Core_BAO_MailSettings',
6a7e5e5d 396 'localizable' => 0,
a9d0587b 397 'add' => '2.2',
c3fc2621
CW
398 ],
399 'activity_status' => [
040073c9
CW
400 'name' => 'activity_status',
401 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 402 'title' => ts('Activity Status'),
215b423e 403 'description' => ts('Name of status to use when creating email to activity.'),
040073c9
CW
404 'maxlength' => 255,
405 'size' => CRM_Utils_Type::HUGE,
a36434b9 406 'where' => 'civicrm_mail_settings.activity_status',
040073c9
CW
407 'table_name' => 'civicrm_mail_settings',
408 'entity' => 'MailSettings',
409 'bao' => 'CRM_Core_BAO_MailSettings',
410 'localizable' => 0,
c3fc2621 411 'html' => [
040073c9 412 'type' => 'Select',
c3fc2621
CW
413 ],
414 'pseudoconstant' => [
040073c9
CW
415 'optionGroupName' => 'activity_status',
416 'keyColumn' => 'name',
417 'optionEditPath' => 'civicrm/admin/options/activity_status',
e6ca0a57 418 ],
a9d0587b 419 'add' => '4.7',
c3fc2621 420 ],
2f0fd07c
SL
421 'is_non_case_email_skipped' => [
422 'name' => 'is_non_case_email_skipped',
423 'type' => CRM_Utils_Type::T_BOOLEAN,
424 'title' => ts('Skip emails which do not have a Case ID or Case hash'),
425 'description' => ts('Enabling this option will have CiviCRM skip any emails that do not have the Case ID or Case Hash so that the system will only process emails that can be placed on case records. Any emails that are not processed will be moved to the ignored folder.'),
426 'where' => 'civicrm_mail_settings.is_non_case_email_skipped',
427 'default' => '0',
428 'table_name' => 'civicrm_mail_settings',
429 'entity' => 'MailSettings',
430 'bao' => 'CRM_Core_BAO_MailSettings',
431 'localizable' => 0,
432 'html' => [
433 'type' => 'CheckBox',
434 ],
435 'add' => '5.31',
436 ],
437 'is_contact_creation_disabled_if_no_match' => [
438 'name' => 'is_contact_creation_disabled_if_no_match',
439 'type' => CRM_Utils_Type::T_BOOLEAN,
440 'title' => ts('Do not create new contacts when filing emails'),
441 'where' => 'civicrm_mail_settings.is_contact_creation_disabled_if_no_match',
442 'default' => '0',
443 'table_name' => 'civicrm_mail_settings',
444 'entity' => 'MailSettings',
445 'bao' => 'CRM_Core_BAO_MailSettings',
446 'localizable' => 0,
447 'html' => [
448 'type' => 'CheckBox',
449 ],
450 'add' => '5.31',
451 ],
c3fc2621 452 ];
346aaaba 453 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 454 }
346aaaba 455 return Civi::$statics[__CLASS__]['fields'];
e501603b 456 }
c3fc2621 457
e501603b 458 /**
bd8e0b14 459 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
460 *
461 * @return array
bd8e0b14 462 * Array(string $name => string $uniqueName).
e501603b 463 */
c3fc2621 464 public static function &fieldKeys() {
bd8e0b14
TO
465 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
466 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 467 }
bd8e0b14 468 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 469 }
c3fc2621 470
e501603b
TO
471 /**
472 * Returns the names of this table
473 *
474 * @return string
475 */
c3fc2621 476 public static function getTableName() {
e501603b
TO
477 return self::$_tableName;
478 }
c3fc2621 479
e501603b
TO
480 /**
481 * Returns if this table needs to be logged
482 *
c3fc2621 483 * @return bool
e501603b 484 */
c3fc2621 485 public function getLog() {
e501603b
TO
486 return self::$_log;
487 }
c3fc2621 488
e501603b
TO
489 /**
490 * Returns the list of fields that can be imported
491 *
492 * @param bool $prefix
493 *
494 * @return array
495 */
c3fc2621
CW
496 public static function &import($prefix = FALSE) {
497 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mail_settings', $prefix, []);
60808919 498 return $r;
e501603b 499 }
c3fc2621 500
e501603b
TO
501 /**
502 * Returns the list of fields that can be exported
503 *
504 * @param bool $prefix
505 *
506 * @return array
507 */
c3fc2621
CW
508 public static function &export($prefix = FALSE) {
509 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mail_settings', $prefix, []);
60808919 510 return $r;
e501603b 511 }
c3fc2621 512
e7a6b91a
AS
513 /**
514 * Returns the list of indices
c3fc2621
CW
515 *
516 * @param bool $localize
517 *
518 * @return array
e7a6b91a
AS
519 */
520 public static function indices($localize = TRUE) {
c3fc2621 521 $indices = [];
e7a6b91a
AS
522 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
523 }
c3fc2621 524
e501603b 525}