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