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:a16e81997bf4b6cb25dfafd32c10a49a)
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;
41 * Which Domain is this match entry for
48 * name of this group of settings
55 * whether this is the default set of settings for this domain
62 * email address domain (the part after @)
69 * optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)
76 * contents of the Return-Path header
83 * name of the protocol to use for polling (like IMAP, POP3 or Maildir)
90 * server to use when polling
97 * port to use when polling
104 * username to use when polling
111 * password to use when polling
118 * whether to use SSL or not
125 * folder to poll from when using IMAP, path to poll from when using Maildir, etc.
132 * Name of status to use when creating email to activity.
136 public $activity_status;
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.
143 public $is_non_case_email_skipped;
148 public $is_contact_creation_disabled_if_no_match;
153 public function __construct() {
154 $this->__table
= 'civicrm_mail_settings';
155 parent
::__construct();
159 * Returns localized title of this entity.
161 * @param bool $plural
162 * Whether to return the plural version of the title.
164 public static function getEntityTitle($plural = FALSE) {
165 return $plural ?
ts('Mail Settingses') : ts('Mail Settings');
169 * Returns foreign keys and entity references.
172 * [CRM_Core_Reference_Interface]
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']);
180 return Civi
::$statics[__CLASS__
]['links'];
184 * Returns all the column names of this table
188 public static function &fields() {
189 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
190 Civi
::$statics[__CLASS__
]['fields'] = [
193 'type' => CRM_Utils_Type
::T_INT
,
194 'title' => ts('Mail Settings ID'),
195 'description' => ts('primary key'),
197 'where' => 'civicrm_mail_settings.id',
198 'table_name' => 'civicrm_mail_settings',
199 'entity' => 'MailSettings',
200 'bao' => 'CRM_Core_BAO_MailSettings',
205 'name' => 'domain_id',
206 'type' => CRM_Utils_Type
::T_INT
,
207 'title' => ts('Mail Settings Domain'),
208 'description' => ts('Which Domain is this match entry for'),
210 'where' => 'civicrm_mail_settings.domain_id',
211 'table_name' => 'civicrm_mail_settings',
212 'entity' => 'MailSettings',
213 'bao' => 'CRM_Core_BAO_MailSettings',
215 'FKClassName' => 'CRM_Core_DAO_Domain',
216 'pseudoconstant' => [
217 'table' => 'civicrm_domain',
219 'labelColumn' => 'name',
225 'type' => CRM_Utils_Type
::T_STRING
,
226 'title' => ts('Mail Settings Name'),
227 'description' => ts('name of this group of settings'),
229 'size' => CRM_Utils_Type
::HUGE
,
230 'where' => 'civicrm_mail_settings.name',
231 'table_name' => 'civicrm_mail_settings',
232 'entity' => 'MailSettings',
233 'bao' => 'CRM_Core_BAO_MailSettings',
238 'name' => 'is_default',
239 'type' => CRM_Utils_Type
::T_BOOLEAN
,
240 'title' => ts('Is Default Mail Settings?'),
241 'description' => ts('whether this is the default set of settings for this domain'),
242 'where' => 'civicrm_mail_settings.is_default',
243 'table_name' => 'civicrm_mail_settings',
244 'entity' => 'MailSettings',
245 'bao' => 'CRM_Core_BAO_MailSettings',
251 'type' => CRM_Utils_Type
::T_STRING
,
252 'title' => ts('email Domain'),
253 'description' => ts('email address domain (the part after @)'),
255 'size' => CRM_Utils_Type
::HUGE
,
256 'where' => 'civicrm_mail_settings.domain',
257 'table_name' => 'civicrm_mail_settings',
258 'entity' => 'MailSettings',
259 'bao' => 'CRM_Core_BAO_MailSettings',
264 'name' => 'localpart',
265 'type' => CRM_Utils_Type
::T_STRING
,
266 'title' => ts('email Local Part'),
267 'description' => ts('optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)'),
269 'size' => CRM_Utils_Type
::HUGE
,
270 'where' => 'civicrm_mail_settings.localpart',
271 'table_name' => 'civicrm_mail_settings',
272 'entity' => 'MailSettings',
273 'bao' => 'CRM_Core_BAO_MailSettings',
278 'name' => 'return_path',
279 'type' => CRM_Utils_Type
::T_STRING
,
280 'title' => ts('Return Path'),
281 'description' => ts('contents of the Return-Path header'),
283 'size' => CRM_Utils_Type
::HUGE
,
284 'where' => 'civicrm_mail_settings.return_path',
285 'table_name' => 'civicrm_mail_settings',
286 'entity' => 'MailSettings',
287 'bao' => 'CRM_Core_BAO_MailSettings',
292 'name' => 'protocol',
293 'type' => CRM_Utils_Type
::T_STRING
,
294 'title' => ts('Protocol'),
295 'description' => ts('name of the protocol to use for polling (like IMAP, POP3 or Maildir)'),
297 'size' => CRM_Utils_Type
::HUGE
,
298 'where' => 'civicrm_mail_settings.protocol',
299 'table_name' => 'civicrm_mail_settings',
300 'entity' => 'MailSettings',
301 'bao' => 'CRM_Core_BAO_MailSettings',
306 'pseudoconstant' => [
307 'optionGroupName' => 'mail_protocol',
308 'optionEditPath' => 'civicrm/admin/options/mail_protocol',
314 'type' => CRM_Utils_Type
::T_STRING
,
315 'title' => ts('Mail Server'),
316 'description' => ts('server to use when polling'),
318 'size' => CRM_Utils_Type
::HUGE
,
319 'where' => 'civicrm_mail_settings.server',
320 'table_name' => 'civicrm_mail_settings',
321 'entity' => 'MailSettings',
322 'bao' => 'CRM_Core_BAO_MailSettings',
328 'type' => CRM_Utils_Type
::T_INT
,
329 'title' => ts('Mail Port'),
330 'description' => ts('port to use when polling'),
331 'where' => 'civicrm_mail_settings.port',
332 'table_name' => 'civicrm_mail_settings',
333 'entity' => 'MailSettings',
334 'bao' => 'CRM_Core_BAO_MailSettings',
339 'name' => 'username',
340 'type' => CRM_Utils_Type
::T_STRING
,
341 'title' => ts('Mail Account Username'),
342 'description' => ts('username to use when polling'),
344 'size' => CRM_Utils_Type
::HUGE
,
345 'where' => 'civicrm_mail_settings.username',
346 'table_name' => 'civicrm_mail_settings',
347 'entity' => 'MailSettings',
348 'bao' => 'CRM_Core_BAO_MailSettings',
353 'name' => 'password',
354 'type' => CRM_Utils_Type
::T_STRING
,
355 'title' => ts('Mail Account Password'),
356 'description' => ts('password to use when polling'),
358 'size' => CRM_Utils_Type
::HUGE
,
359 'where' => 'civicrm_mail_settings.password',
360 'table_name' => 'civicrm_mail_settings',
361 'entity' => 'MailSettings',
362 'bao' => 'CRM_Core_BAO_MailSettings',
368 'type' => CRM_Utils_Type
::T_BOOLEAN
,
369 'title' => ts('Mail Account Uses SSL'),
370 'description' => ts('whether to use SSL or not'),
371 'where' => 'civicrm_mail_settings.is_ssl',
372 'table_name' => 'civicrm_mail_settings',
373 'entity' => 'MailSettings',
374 'bao' => 'CRM_Core_BAO_MailSettings',
380 'type' => CRM_Utils_Type
::T_STRING
,
381 'title' => ts('Mail Folder'),
382 'description' => ts('folder to poll from when using IMAP, path to poll from when using Maildir, etc.'),
384 'size' => CRM_Utils_Type
::HUGE
,
385 'where' => 'civicrm_mail_settings.source',
386 'table_name' => 'civicrm_mail_settings',
387 'entity' => 'MailSettings',
388 'bao' => 'CRM_Core_BAO_MailSettings',
392 'activity_status' => [
393 'name' => 'activity_status',
394 'type' => CRM_Utils_Type
::T_STRING
,
395 'title' => ts('Activity Status'),
396 'description' => ts('Name of status to use when creating email to activity.'),
398 'size' => CRM_Utils_Type
::HUGE
,
399 'where' => 'civicrm_mail_settings.activity_status',
400 'table_name' => 'civicrm_mail_settings',
401 'entity' => 'MailSettings',
402 'bao' => 'CRM_Core_BAO_MailSettings',
407 'pseudoconstant' => [
408 'optionGroupName' => 'activity_status',
409 'keyColumn' => 'name',
410 'optionEditPath' => 'civicrm/admin/options/activity_status',
414 'is_non_case_email_skipped' => [
415 'name' => 'is_non_case_email_skipped',
416 'type' => CRM_Utils_Type
::T_BOOLEAN
,
417 'title' => ts('Skip emails which do not have a Case ID or Case hash'),
418 '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.'),
419 'where' => 'civicrm_mail_settings.is_non_case_email_skipped',
421 'table_name' => 'civicrm_mail_settings',
422 'entity' => 'MailSettings',
423 'bao' => 'CRM_Core_BAO_MailSettings',
426 'type' => 'CheckBox',
430 'is_contact_creation_disabled_if_no_match' => [
431 'name' => 'is_contact_creation_disabled_if_no_match',
432 'type' => CRM_Utils_Type
::T_BOOLEAN
,
433 'title' => ts('Do not create new contacts when filing emails'),
434 'where' => 'civicrm_mail_settings.is_contact_creation_disabled_if_no_match',
436 'table_name' => 'civicrm_mail_settings',
437 'entity' => 'MailSettings',
438 'bao' => 'CRM_Core_BAO_MailSettings',
441 'type' => 'CheckBox',
446 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
448 return Civi
::$statics[__CLASS__
]['fields'];
452 * Return a mapping from field-name to the corresponding key (as used in fields()).
455 * Array(string $name => string $uniqueName).
457 public static function &fieldKeys() {
458 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
459 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
461 return Civi
::$statics[__CLASS__
]['fieldKeys'];
465 * Returns the names of this table
469 public static function getTableName() {
470 return self
::$_tableName;
474 * Returns if this table needs to be logged
478 public function getLog() {
483 * Returns the list of fields that can be imported
485 * @param bool $prefix
489 public static function &import($prefix = FALSE) {
490 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mail_settings', $prefix, []);
495 * Returns the list of fields that can be exported
497 * @param bool $prefix
501 public static function &export($prefix = FALSE) {
502 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mail_settings', $prefix, []);
507 * Returns the list of indices
509 * @param bool $localize
513 public static function indices($localize = TRUE) {
515 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;