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:310f3c60fe656e8ef27a67234d6fa80c)
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;
141 public function __construct() {
142 $this->__table
= 'civicrm_mail_settings';
143 parent
::__construct();
147 * Returns localized title of this entity.
149 * @param bool $plural
150 * Whether to return the plural version of the title.
152 public static function getEntityTitle($plural = FALSE) {
153 return $plural ?
ts('Mail Settingses') : ts('Mail Settings');
157 * Returns foreign keys and entity references.
160 * [CRM_Core_Reference_Interface]
162 public static function getReferenceColumns() {
163 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
164 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
165 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
166 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
168 return Civi
::$statics[__CLASS__
]['links'];
172 * Returns all the column names of this table
176 public static function &fields() {
177 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
178 Civi
::$statics[__CLASS__
]['fields'] = [
181 'type' => CRM_Utils_Type
::T_INT
,
182 'title' => ts('Mail Settings ID'),
183 'description' => ts('primary key'),
185 'where' => 'civicrm_mail_settings.id',
186 'table_name' => 'civicrm_mail_settings',
187 'entity' => 'MailSettings',
188 'bao' => 'CRM_Core_BAO_MailSettings',
193 'name' => 'domain_id',
194 'type' => CRM_Utils_Type
::T_INT
,
195 'title' => ts('Mail Settings Domain'),
196 'description' => ts('Which Domain is this match entry for'),
198 'where' => 'civicrm_mail_settings.domain_id',
199 'table_name' => 'civicrm_mail_settings',
200 'entity' => 'MailSettings',
201 'bao' => 'CRM_Core_BAO_MailSettings',
203 'FKClassName' => 'CRM_Core_DAO_Domain',
204 'pseudoconstant' => [
205 'table' => 'civicrm_domain',
207 'labelColumn' => 'name',
213 'type' => CRM_Utils_Type
::T_STRING
,
214 'title' => ts('Mail Settings Name'),
215 'description' => ts('name of this group of settings'),
217 'size' => CRM_Utils_Type
::HUGE
,
218 'where' => 'civicrm_mail_settings.name',
219 'table_name' => 'civicrm_mail_settings',
220 'entity' => 'MailSettings',
221 'bao' => 'CRM_Core_BAO_MailSettings',
226 'name' => 'is_default',
227 'type' => CRM_Utils_Type
::T_BOOLEAN
,
228 'title' => ts('Is Default Mail Settings?'),
229 'description' => ts('whether this is the default set of settings for this domain'),
230 'where' => 'civicrm_mail_settings.is_default',
231 'table_name' => 'civicrm_mail_settings',
232 'entity' => 'MailSettings',
233 'bao' => 'CRM_Core_BAO_MailSettings',
239 'type' => CRM_Utils_Type
::T_STRING
,
240 'title' => ts('email Domain'),
241 'description' => ts('email address domain (the part after @)'),
243 'size' => CRM_Utils_Type
::HUGE
,
244 'where' => 'civicrm_mail_settings.domain',
245 'table_name' => 'civicrm_mail_settings',
246 'entity' => 'MailSettings',
247 'bao' => 'CRM_Core_BAO_MailSettings',
252 'name' => 'localpart',
253 'type' => CRM_Utils_Type
::T_STRING
,
254 'title' => ts('email Local Part'),
255 'description' => ts('optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)'),
257 'size' => CRM_Utils_Type
::HUGE
,
258 'where' => 'civicrm_mail_settings.localpart',
259 'table_name' => 'civicrm_mail_settings',
260 'entity' => 'MailSettings',
261 'bao' => 'CRM_Core_BAO_MailSettings',
266 'name' => 'return_path',
267 'type' => CRM_Utils_Type
::T_STRING
,
268 'title' => ts('Return Path'),
269 'description' => ts('contents of the Return-Path header'),
271 'size' => CRM_Utils_Type
::HUGE
,
272 'where' => 'civicrm_mail_settings.return_path',
273 'table_name' => 'civicrm_mail_settings',
274 'entity' => 'MailSettings',
275 'bao' => 'CRM_Core_BAO_MailSettings',
280 'name' => 'protocol',
281 'type' => CRM_Utils_Type
::T_STRING
,
282 'title' => ts('Protocol'),
283 'description' => ts('name of the protocol to use for polling (like IMAP, POP3 or Maildir)'),
285 'size' => CRM_Utils_Type
::HUGE
,
286 'where' => 'civicrm_mail_settings.protocol',
287 'table_name' => 'civicrm_mail_settings',
288 'entity' => 'MailSettings',
289 'bao' => 'CRM_Core_BAO_MailSettings',
294 'pseudoconstant' => [
295 'optionGroupName' => 'mail_protocol',
296 'optionEditPath' => 'civicrm/admin/options/mail_protocol',
302 'type' => CRM_Utils_Type
::T_STRING
,
303 'title' => ts('Mail Server'),
304 'description' => ts('server to use when polling'),
306 'size' => CRM_Utils_Type
::HUGE
,
307 'where' => 'civicrm_mail_settings.server',
308 'table_name' => 'civicrm_mail_settings',
309 'entity' => 'MailSettings',
310 'bao' => 'CRM_Core_BAO_MailSettings',
316 'type' => CRM_Utils_Type
::T_INT
,
317 'title' => ts('Mail Port'),
318 'description' => ts('port to use when polling'),
319 'where' => 'civicrm_mail_settings.port',
320 'table_name' => 'civicrm_mail_settings',
321 'entity' => 'MailSettings',
322 'bao' => 'CRM_Core_BAO_MailSettings',
327 'name' => 'username',
328 'type' => CRM_Utils_Type
::T_STRING
,
329 'title' => ts('Mail Account Username'),
330 'description' => ts('username to use when polling'),
332 'size' => CRM_Utils_Type
::HUGE
,
333 'where' => 'civicrm_mail_settings.username',
334 'table_name' => 'civicrm_mail_settings',
335 'entity' => 'MailSettings',
336 'bao' => 'CRM_Core_BAO_MailSettings',
341 'name' => 'password',
342 'type' => CRM_Utils_Type
::T_STRING
,
343 'title' => ts('Mail Account Password'),
344 'description' => ts('password to use when polling'),
346 'size' => CRM_Utils_Type
::HUGE
,
347 'where' => 'civicrm_mail_settings.password',
348 'table_name' => 'civicrm_mail_settings',
349 'entity' => 'MailSettings',
350 'bao' => 'CRM_Core_BAO_MailSettings',
356 'type' => CRM_Utils_Type
::T_BOOLEAN
,
357 'title' => ts('Mail Account Uses SSL'),
358 'description' => ts('whether to use SSL or not'),
359 'where' => 'civicrm_mail_settings.is_ssl',
360 'table_name' => 'civicrm_mail_settings',
361 'entity' => 'MailSettings',
362 'bao' => 'CRM_Core_BAO_MailSettings',
368 'type' => CRM_Utils_Type
::T_STRING
,
369 'title' => ts('Mail Folder'),
370 'description' => ts('folder to poll from when using IMAP, path to poll from when using Maildir, etc.'),
372 'size' => CRM_Utils_Type
::HUGE
,
373 'where' => 'civicrm_mail_settings.source',
374 'table_name' => 'civicrm_mail_settings',
375 'entity' => 'MailSettings',
376 'bao' => 'CRM_Core_BAO_MailSettings',
380 'activity_status' => [
381 'name' => 'activity_status',
382 'type' => CRM_Utils_Type
::T_STRING
,
383 'title' => ts('Activity Status'),
384 'description' => ts('Name of status to use when creating email to activity.'),
386 'size' => CRM_Utils_Type
::HUGE
,
387 'where' => 'civicrm_mail_settings.activity_status',
388 'table_name' => 'civicrm_mail_settings',
389 'entity' => 'MailSettings',
390 'bao' => 'CRM_Core_BAO_MailSettings',
395 'pseudoconstant' => [
396 'optionGroupName' => 'activity_status',
397 'keyColumn' => 'name',
398 'optionEditPath' => 'civicrm/admin/options/activity_status',
403 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
405 return Civi
::$statics[__CLASS__
]['fields'];
409 * Return a mapping from field-name to the corresponding key (as used in fields()).
412 * Array(string $name => string $uniqueName).
414 public static function &fieldKeys() {
415 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
416 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
418 return Civi
::$statics[__CLASS__
]['fieldKeys'];
422 * Returns the names of this table
426 public static function getTableName() {
427 return self
::$_tableName;
431 * Returns if this table needs to be logged
435 public function getLog() {
440 * Returns the list of fields that can be imported
442 * @param bool $prefix
446 public static function &import($prefix = FALSE) {
447 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mail_settings', $prefix, []);
452 * Returns the list of fields that can be exported
454 * @param bool $prefix
458 public static function &export($prefix = FALSE) {
459 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mail_settings', $prefix, []);
464 * Returns the list of indices
466 * @param bool $localize
470 public static function indices($localize = TRUE) {
472 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;