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