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:1c0272c8ff0392b03ef4a1f6ab23c0df)
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',
187 'name' => 'domain_id',
188 'type' => CRM_Utils_Type
::T_INT
,
189 'title' => ts('Mail Settings Domain'),
190 'description' => ts('Which Domain is this match entry for'),
192 'where' => 'civicrm_mail_settings.domain_id',
193 'table_name' => 'civicrm_mail_settings',
194 'entity' => 'MailSettings',
195 'bao' => 'CRM_Core_BAO_MailSettings',
197 'FKClassName' => 'CRM_Core_DAO_Domain',
198 'pseudoconstant' => [
199 'table' => 'civicrm_domain',
201 'labelColumn' => 'name',
206 'type' => CRM_Utils_Type
::T_STRING
,
207 'title' => ts('Mail Settings Name'),
208 'description' => ts('name of this group of settings'),
210 'size' => CRM_Utils_Type
::HUGE
,
211 'where' => 'civicrm_mail_settings.name',
212 'table_name' => 'civicrm_mail_settings',
213 'entity' => 'MailSettings',
214 'bao' => 'CRM_Core_BAO_MailSettings',
218 'name' => 'is_default',
219 'type' => CRM_Utils_Type
::T_BOOLEAN
,
220 'title' => ts('Is Default Mail Settings?'),
221 'description' => ts('whether this is the default set of settings for this domain'),
222 'where' => 'civicrm_mail_settings.is_default',
223 'table_name' => 'civicrm_mail_settings',
224 'entity' => 'MailSettings',
225 'bao' => 'CRM_Core_BAO_MailSettings',
230 'type' => CRM_Utils_Type
::T_STRING
,
231 'title' => ts('email Domain'),
232 'description' => ts('email address domain (the part after @)'),
234 'size' => CRM_Utils_Type
::HUGE
,
235 'where' => 'civicrm_mail_settings.domain',
236 'table_name' => 'civicrm_mail_settings',
237 'entity' => 'MailSettings',
238 'bao' => 'CRM_Core_BAO_MailSettings',
242 'name' => 'localpart',
243 'type' => CRM_Utils_Type
::T_STRING
,
244 'title' => ts('email Local Part'),
245 'description' => ts('optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)'),
247 'size' => CRM_Utils_Type
::HUGE
,
248 'where' => 'civicrm_mail_settings.localpart',
249 'table_name' => 'civicrm_mail_settings',
250 'entity' => 'MailSettings',
251 'bao' => 'CRM_Core_BAO_MailSettings',
255 'name' => 'return_path',
256 'type' => CRM_Utils_Type
::T_STRING
,
257 'title' => ts('Return Path'),
258 'description' => ts('contents of the Return-Path header'),
260 'size' => CRM_Utils_Type
::HUGE
,
261 'where' => 'civicrm_mail_settings.return_path',
262 'table_name' => 'civicrm_mail_settings',
263 'entity' => 'MailSettings',
264 'bao' => 'CRM_Core_BAO_MailSettings',
268 'name' => 'protocol',
269 'type' => CRM_Utils_Type
::T_STRING
,
270 'title' => ts('Protocol'),
271 'description' => ts('name of the protocol to use for polling (like IMAP, POP3 or Maildir)'),
273 'size' => CRM_Utils_Type
::HUGE
,
274 'where' => 'civicrm_mail_settings.protocol',
275 'table_name' => 'civicrm_mail_settings',
276 'entity' => 'MailSettings',
277 'bao' => 'CRM_Core_BAO_MailSettings',
282 'pseudoconstant' => [
283 'optionGroupName' => 'mail_protocol',
284 'optionEditPath' => 'civicrm/admin/options/mail_protocol',
289 'type' => CRM_Utils_Type
::T_STRING
,
290 'title' => ts('Mail Server'),
291 'description' => ts('server to use when polling'),
293 'size' => CRM_Utils_Type
::HUGE
,
294 'where' => 'civicrm_mail_settings.server',
295 'table_name' => 'civicrm_mail_settings',
296 'entity' => 'MailSettings',
297 'bao' => 'CRM_Core_BAO_MailSettings',
302 'type' => CRM_Utils_Type
::T_INT
,
303 'title' => ts('Mail Port'),
304 'description' => ts('port to use when polling'),
305 'where' => 'civicrm_mail_settings.port',
306 'table_name' => 'civicrm_mail_settings',
307 'entity' => 'MailSettings',
308 'bao' => 'CRM_Core_BAO_MailSettings',
312 'name' => 'username',
313 'type' => CRM_Utils_Type
::T_STRING
,
314 'title' => ts('Mail Account Username'),
315 'description' => ts('username to use when polling'),
317 'size' => CRM_Utils_Type
::HUGE
,
318 'where' => 'civicrm_mail_settings.username',
319 'table_name' => 'civicrm_mail_settings',
320 'entity' => 'MailSettings',
321 'bao' => 'CRM_Core_BAO_MailSettings',
325 'name' => 'password',
326 'type' => CRM_Utils_Type
::T_STRING
,
327 'title' => ts('Mail Account Password'),
328 'description' => ts('password to use when polling'),
330 'size' => CRM_Utils_Type
::HUGE
,
331 'where' => 'civicrm_mail_settings.password',
332 'table_name' => 'civicrm_mail_settings',
333 'entity' => 'MailSettings',
334 'bao' => 'CRM_Core_BAO_MailSettings',
339 'type' => CRM_Utils_Type
::T_BOOLEAN
,
340 'title' => ts('Mail Account Uses SSL'),
341 'description' => ts('whether to use SSL or not'),
342 'where' => 'civicrm_mail_settings.is_ssl',
343 'table_name' => 'civicrm_mail_settings',
344 'entity' => 'MailSettings',
345 'bao' => 'CRM_Core_BAO_MailSettings',
350 'type' => CRM_Utils_Type
::T_STRING
,
351 'title' => ts('Mail Folder'),
352 'description' => ts('folder to poll from when using IMAP, path to poll from when using Maildir, etc.'),
354 'size' => CRM_Utils_Type
::HUGE
,
355 'where' => 'civicrm_mail_settings.source',
356 'table_name' => 'civicrm_mail_settings',
357 'entity' => 'MailSettings',
358 'bao' => 'CRM_Core_BAO_MailSettings',
361 'activity_status' => [
362 'name' => 'activity_status',
363 'type' => CRM_Utils_Type
::T_STRING
,
364 'title' => ts('Activity Status'),
365 'description' => ts('Name of status to use when creating email to activity.'),
367 'size' => CRM_Utils_Type
::HUGE
,
368 'where' => 'civicrm_mail_settings.activity_status',
369 'table_name' => 'civicrm_mail_settings',
370 'entity' => 'MailSettings',
371 'bao' => 'CRM_Core_BAO_MailSettings',
376 'pseudoconstant' => [
377 'optionGroupName' => 'activity_status',
378 'keyColumn' => 'name',
379 'optionEditPath' => 'civicrm/admin/options/activity_status',
383 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
385 return Civi
::$statics[__CLASS__
]['fields'];
389 * Return a mapping from field-name to the corresponding key (as used in fields()).
392 * Array(string $name => string $uniqueName).
394 public static function &fieldKeys() {
395 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
396 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
398 return Civi
::$statics[__CLASS__
]['fieldKeys'];
402 * Returns the names of this table
406 public static function getTableName() {
407 return self
::$_tableName;
411 * Returns if this table needs to be logged
415 public function getLog() {
420 * Returns the list of fields that can be imported
422 * @param bool $prefix
426 public static function &import($prefix = FALSE) {
427 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mail_settings', $prefix, []);
432 * Returns the list of fields that can be exported
434 * @param bool $prefix
438 public static function &export($prefix = FALSE) {
439 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mail_settings', $prefix, []);
444 * Returns the list of indices
446 * @param bool $localize
450 public static function indices($localize = TRUE) {
452 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;