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:455750fee6f1acbe50aeb19387f12158)
13 * Database access object for the MailSettings entity.
15 class CRM_Core_DAO_MailSettings
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_mail_settings';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
39 * Which Domain is this match entry for
46 * name of this group of settings
53 * whether this is the default set of settings for this domain
60 * email address domain (the part after @)
67 * optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)
74 * contents of the Return-Path header
81 * name of the protocol to use for polling (like IMAP, POP3 or Maildir)
88 * server to use when polling
95 * port to use when polling
102 * username to use when polling
109 * password to use when polling
116 * whether to use SSL or not
123 * folder to poll from when using IMAP, path to poll from when using Maildir, etc.
130 * Name of status to use when creating email to activity.
134 public $activity_status;
139 public function __construct() {
140 $this->__table
= 'civicrm_mail_settings';
141 parent
::__construct();
145 * Returns localized title of this entity.
147 public static function getEntityTitle() {
148 return ts('Mail Settingses');
152 * Returns foreign keys and entity references.
155 * [CRM_Core_Reference_Interface]
157 public static function getReferenceColumns() {
158 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
159 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
160 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
161 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
163 return Civi
::$statics[__CLASS__
]['links'];
167 * Returns all the column names of this table
171 public static function &fields() {
172 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
173 Civi
::$statics[__CLASS__
]['fields'] = [
176 'type' => CRM_Utils_Type
::T_INT
,
177 'title' => ts('Mail Settings ID'),
178 'description' => ts('primary key'),
180 'where' => 'civicrm_mail_settings.id',
181 'table_name' => 'civicrm_mail_settings',
182 'entity' => 'MailSettings',
183 'bao' => 'CRM_Core_BAO_MailSettings',
188 'name' => 'domain_id',
189 'type' => CRM_Utils_Type
::T_INT
,
190 'title' => ts('Mail Settings Domain'),
191 'description' => ts('Which Domain is this match entry for'),
193 'where' => 'civicrm_mail_settings.domain_id',
194 'table_name' => 'civicrm_mail_settings',
195 'entity' => 'MailSettings',
196 'bao' => 'CRM_Core_BAO_MailSettings',
198 'FKClassName' => 'CRM_Core_DAO_Domain',
199 'pseudoconstant' => [
200 'table' => 'civicrm_domain',
202 'labelColumn' => 'name',
208 'type' => CRM_Utils_Type
::T_STRING
,
209 'title' => ts('Mail Settings Name'),
210 'description' => ts('name of this group of settings'),
212 'size' => CRM_Utils_Type
::HUGE
,
213 'where' => 'civicrm_mail_settings.name',
214 'table_name' => 'civicrm_mail_settings',
215 'entity' => 'MailSettings',
216 'bao' => 'CRM_Core_BAO_MailSettings',
221 'name' => 'is_default',
222 'type' => CRM_Utils_Type
::T_BOOLEAN
,
223 'title' => ts('Is Default Mail Settings?'),
224 'description' => ts('whether this is the default set of settings for this domain'),
225 'where' => 'civicrm_mail_settings.is_default',
226 'table_name' => 'civicrm_mail_settings',
227 'entity' => 'MailSettings',
228 'bao' => 'CRM_Core_BAO_MailSettings',
234 'type' => CRM_Utils_Type
::T_STRING
,
235 'title' => ts('email Domain'),
236 'description' => ts('email address domain (the part after @)'),
238 'size' => CRM_Utils_Type
::HUGE
,
239 'where' => 'civicrm_mail_settings.domain',
240 'table_name' => 'civicrm_mail_settings',
241 'entity' => 'MailSettings',
242 'bao' => 'CRM_Core_BAO_MailSettings',
247 'name' => 'localpart',
248 'type' => CRM_Utils_Type
::T_STRING
,
249 'title' => ts('email Local Part'),
250 'description' => ts('optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)'),
252 'size' => CRM_Utils_Type
::HUGE
,
253 'where' => 'civicrm_mail_settings.localpart',
254 'table_name' => 'civicrm_mail_settings',
255 'entity' => 'MailSettings',
256 'bao' => 'CRM_Core_BAO_MailSettings',
261 'name' => 'return_path',
262 'type' => CRM_Utils_Type
::T_STRING
,
263 'title' => ts('Return Path'),
264 'description' => ts('contents of the Return-Path header'),
266 'size' => CRM_Utils_Type
::HUGE
,
267 'where' => 'civicrm_mail_settings.return_path',
268 'table_name' => 'civicrm_mail_settings',
269 'entity' => 'MailSettings',
270 'bao' => 'CRM_Core_BAO_MailSettings',
275 'name' => 'protocol',
276 'type' => CRM_Utils_Type
::T_STRING
,
277 'title' => ts('Protocol'),
278 'description' => ts('name of the protocol to use for polling (like IMAP, POP3 or Maildir)'),
280 'size' => CRM_Utils_Type
::HUGE
,
281 'where' => 'civicrm_mail_settings.protocol',
282 'table_name' => 'civicrm_mail_settings',
283 'entity' => 'MailSettings',
284 'bao' => 'CRM_Core_BAO_MailSettings',
289 'pseudoconstant' => [
290 'optionGroupName' => 'mail_protocol',
291 'optionEditPath' => 'civicrm/admin/options/mail_protocol',
297 'type' => CRM_Utils_Type
::T_STRING
,
298 'title' => ts('Mail Server'),
299 'description' => ts('server to use when polling'),
301 'size' => CRM_Utils_Type
::HUGE
,
302 'where' => 'civicrm_mail_settings.server',
303 'table_name' => 'civicrm_mail_settings',
304 'entity' => 'MailSettings',
305 'bao' => 'CRM_Core_BAO_MailSettings',
311 'type' => CRM_Utils_Type
::T_INT
,
312 'title' => ts('Mail Port'),
313 'description' => ts('port to use when polling'),
314 'where' => 'civicrm_mail_settings.port',
315 'table_name' => 'civicrm_mail_settings',
316 'entity' => 'MailSettings',
317 'bao' => 'CRM_Core_BAO_MailSettings',
322 'name' => 'username',
323 'type' => CRM_Utils_Type
::T_STRING
,
324 'title' => ts('Mail Account Username'),
325 'description' => ts('username to use when polling'),
327 'size' => CRM_Utils_Type
::HUGE
,
328 'where' => 'civicrm_mail_settings.username',
329 'table_name' => 'civicrm_mail_settings',
330 'entity' => 'MailSettings',
331 'bao' => 'CRM_Core_BAO_MailSettings',
336 'name' => 'password',
337 'type' => CRM_Utils_Type
::T_STRING
,
338 'title' => ts('Mail Account Password'),
339 'description' => ts('password to use when polling'),
341 'size' => CRM_Utils_Type
::HUGE
,
342 'where' => 'civicrm_mail_settings.password',
343 'table_name' => 'civicrm_mail_settings',
344 'entity' => 'MailSettings',
345 'bao' => 'CRM_Core_BAO_MailSettings',
351 'type' => CRM_Utils_Type
::T_BOOLEAN
,
352 'title' => ts('Mail Account Uses SSL'),
353 'description' => ts('whether to use SSL or not'),
354 'where' => 'civicrm_mail_settings.is_ssl',
355 'table_name' => 'civicrm_mail_settings',
356 'entity' => 'MailSettings',
357 'bao' => 'CRM_Core_BAO_MailSettings',
363 'type' => CRM_Utils_Type
::T_STRING
,
364 'title' => ts('Mail Folder'),
365 'description' => ts('folder to poll from when using IMAP, path to poll from when using Maildir, etc.'),
367 'size' => CRM_Utils_Type
::HUGE
,
368 'where' => 'civicrm_mail_settings.source',
369 'table_name' => 'civicrm_mail_settings',
370 'entity' => 'MailSettings',
371 'bao' => 'CRM_Core_BAO_MailSettings',
375 'activity_status' => [
376 'name' => 'activity_status',
377 'type' => CRM_Utils_Type
::T_STRING
,
378 'title' => ts('Activity Status'),
379 'description' => ts('Name of status to use when creating email to activity.'),
381 'size' => CRM_Utils_Type
::HUGE
,
382 'where' => 'civicrm_mail_settings.activity_status',
383 'table_name' => 'civicrm_mail_settings',
384 'entity' => 'MailSettings',
385 'bao' => 'CRM_Core_BAO_MailSettings',
390 'pseudoconstant' => [
391 'optionGroupName' => 'activity_status',
392 'keyColumn' => 'name',
393 'optionEditPath' => 'civicrm/admin/options/activity_status',
398 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
400 return Civi
::$statics[__CLASS__
]['fields'];
404 * Return a mapping from field-name to the corresponding key (as used in fields()).
407 * Array(string $name => string $uniqueName).
409 public static function &fieldKeys() {
410 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
411 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
413 return Civi
::$statics[__CLASS__
]['fieldKeys'];
417 * Returns the names of this table
421 public static function getTableName() {
422 return self
::$_tableName;
426 * Returns if this table needs to be logged
430 public function getLog() {
435 * Returns the list of fields that can be imported
437 * @param bool $prefix
441 public static function &import($prefix = FALSE) {
442 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mail_settings', $prefix, []);
447 * Returns the list of fields that can be exported
449 * @param bool $prefix
453 public static function &export($prefix = FALSE) {
454 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mail_settings', $prefix, []);
459 * Returns the list of indices
461 * @param bool $localize
465 public static function indices($localize = TRUE) {
467 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;