5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Core/MailSettings.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:d31cb841b4c5f88a27dacae0ab50a618)
13 * Database access object for the MailSettings entity.
15 class CRM_Core_DAO_MailSettings
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '2.2';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_mail_settings';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
36 * @var int|string|null
37 * (SQL type: int unsigned)
38 * Note that values will be retrieved from the database as a string.
43 * Which Domain is this match entry for
46 * (SQL type: int unsigned)
47 * Note that values will be retrieved from the database as a string.
52 * name of this group of settings
55 * (SQL type: varchar(255))
56 * Note that values will be retrieved from the database as a string.
61 * whether this is the default set of settings for this domain
65 * Note that values will be retrieved from the database as a string.
70 * email address domain (the part after @)
73 * (SQL type: varchar(255))
74 * Note that values will be retrieved from the database as a string.
79 * optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)
82 * (SQL type: varchar(255))
83 * Note that values will be retrieved from the database as a string.
88 * contents of the Return-Path header
91 * (SQL type: varchar(255))
92 * Note that values will be retrieved from the database as a string.
97 * name of the protocol to use for polling (like IMAP, POP3 or Maildir)
100 * (SQL type: varchar(255))
101 * Note that values will be retrieved from the database as a string.
106 * server to use when polling
109 * (SQL type: varchar(255))
110 * Note that values will be retrieved from the database as a string.
115 * port to use when polling
117 * @var int|string|null
118 * (SQL type: int unsigned)
119 * Note that values will be retrieved from the database as a string.
124 * username to use when polling
127 * (SQL type: varchar(255))
128 * Note that values will be retrieved from the database as a string.
133 * password to use when polling
136 * (SQL type: varchar(255))
137 * Note that values will be retrieved from the database as a string.
142 * whether to use SSL or not
145 * (SQL type: tinyint)
146 * Note that values will be retrieved from the database as a string.
151 * folder to poll from when using IMAP, path to poll from when using Maildir, etc.
154 * (SQL type: varchar(255))
155 * Note that values will be retrieved from the database as a string.
160 * Name of status to use when creating email to activity.
163 * (SQL type: varchar(255))
164 * Note that values will be retrieved from the database as a string.
166 public $activity_status;
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.
172 * (SQL type: tinyint)
173 * Note that values will be retrieved from the database as a string.
175 public $is_non_case_email_skipped;
179 * (SQL type: tinyint)
180 * Note that values will be retrieved from the database as a string.
182 public $is_contact_creation_disabled_if_no_match;
187 public function __construct() {
188 $this->__table
= 'civicrm_mail_settings';
189 parent
::__construct();
193 * Returns localized title of this entity.
195 * @param bool $plural
196 * Whether to return the plural version of the title.
198 public static function getEntityTitle($plural = FALSE) {
199 return $plural ?
ts('Mail Settingses') : ts('Mail Settings');
203 * Returns foreign keys and entity references.
206 * [CRM_Core_Reference_Interface]
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']);
214 return Civi
::$statics[__CLASS__
]['links'];
218 * Returns all the column names of this table
222 public static function &fields() {
223 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
224 Civi
::$statics[__CLASS__
]['fields'] = [
227 'type' => CRM_Utils_Type
::T_INT
,
228 'title' => ts('Mail Settings ID'),
229 'description' => ts('primary key'),
231 'where' => 'civicrm_mail_settings.id',
232 'table_name' => 'civicrm_mail_settings',
233 'entity' => 'MailSettings',
234 'bao' => 'CRM_Core_BAO_MailSettings',
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'),
248 'where' => 'civicrm_mail_settings.domain_id',
249 'table_name' => 'civicrm_mail_settings',
250 'entity' => 'MailSettings',
251 'bao' => 'CRM_Core_BAO_MailSettings',
253 'FKClassName' => 'CRM_Core_DAO_Domain',
255 'label' => ts("Domain"),
257 'pseudoconstant' => [
258 'table' => 'civicrm_domain',
260 'labelColumn' => 'name',
266 'type' => CRM_Utils_Type
::T_STRING
,
267 'title' => ts('Mail Settings Name'),
268 'description' => ts('name of this group of settings'),
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',
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'),
284 'where' => 'civicrm_mail_settings.is_default',
286 'table_name' => 'civicrm_mail_settings',
287 'entity' => 'MailSettings',
288 'bao' => 'CRM_Core_BAO_MailSettings',
294 'type' => CRM_Utils_Type
::T_STRING
,
295 'title' => ts('email Domain'),
296 'description' => ts('email address domain (the part after @)'),
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',
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)'),
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',
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'),
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',
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)'),
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',
349 'pseudoconstant' => [
350 'optionGroupName' => 'mail_protocol',
351 'optionEditPath' => 'civicrm/admin/options/mail_protocol',
357 'type' => CRM_Utils_Type
::T_STRING
,
358 'title' => ts('Mail Server'),
359 'description' => ts('server to use when polling'),
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',
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',
382 'name' => 'username',
383 'type' => CRM_Utils_Type
::T_STRING
,
384 'title' => ts('Mail Account Username'),
385 'description' => ts('username to use when polling'),
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',
396 'name' => 'password',
397 'type' => CRM_Utils_Type
::T_STRING
,
398 'title' => ts('Mail Account Password'),
399 'description' => ts('password to use when polling'),
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',
411 'type' => CRM_Utils_Type
::T_BOOLEAN
,
412 'title' => ts('Mail Account Uses SSL'),
413 'description' => ts('whether to use SSL or not'),
415 'where' => 'civicrm_mail_settings.is_ssl',
417 'table_name' => 'civicrm_mail_settings',
418 'entity' => 'MailSettings',
419 'bao' => 'CRM_Core_BAO_MailSettings',
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.'),
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',
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.'),
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',
452 'pseudoconstant' => [
453 'optionGroupName' => 'activity_status',
454 'keyColumn' => 'name',
455 'optionEditPath' => 'civicrm/admin/options/activity_status',
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.'),
465 'where' => 'civicrm_mail_settings.is_non_case_email_skipped',
467 'table_name' => 'civicrm_mail_settings',
468 'entity' => 'MailSettings',
469 'bao' => 'CRM_Core_BAO_MailSettings',
472 'type' => 'CheckBox',
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'),
481 'where' => 'civicrm_mail_settings.is_contact_creation_disabled_if_no_match',
483 'table_name' => 'civicrm_mail_settings',
484 'entity' => 'MailSettings',
485 'bao' => 'CRM_Core_BAO_MailSettings',
488 'type' => 'CheckBox',
493 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
495 return Civi
::$statics[__CLASS__
]['fields'];
499 * Return a mapping from field-name to the corresponding key (as used in fields()).
502 * Array(string $name => string $uniqueName).
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()));
508 return Civi
::$statics[__CLASS__
]['fieldKeys'];
512 * Returns the names of this table
516 public static function getTableName() {
517 return self
::$_tableName;
521 * Returns if this table needs to be logged
525 public function getLog() {
530 * Returns the list of fields that can be imported
532 * @param bool $prefix
536 public static function &import($prefix = FALSE) {
537 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mail_settings', $prefix, []);
542 * Returns the list of fields that can be exported
544 * @param bool $prefix
548 public static function &export($prefix = FALSE) {
549 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mail_settings', $prefix, []);
554 * Returns the list of indices
556 * @param bool $localize
560 public static function indices($localize = TRUE) {
562 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;