5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Core/MailSettings.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:1818e655bde2e2a0ecd15e7d645ba58a)
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 foreign keys and entity references.
148 * [CRM_Core_Reference_Interface]
150 public static function getReferenceColumns() {
151 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
152 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
153 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'domain_id', 'civicrm_domain', 'id');
154 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
156 return Civi
::$statics[__CLASS__
]['links'];
160 * Returns all the column names of this table
164 public static function &fields() {
165 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
166 Civi
::$statics[__CLASS__
]['fields'] = [
169 'type' => CRM_Utils_Type
::T_INT
,
170 'title' => ts('Mail Settings ID'),
171 'description' => ts('primary key'),
173 'where' => 'civicrm_mail_settings.id',
174 'table_name' => 'civicrm_mail_settings',
175 'entity' => 'MailSettings',
176 'bao' => 'CRM_Core_BAO_MailSettings',
180 'name' => 'domain_id',
181 'type' => CRM_Utils_Type
::T_INT
,
182 'title' => ts('Mail Settings Domain'),
183 'description' => ts('Which Domain is this match entry for'),
185 'where' => 'civicrm_mail_settings.domain_id',
186 'table_name' => 'civicrm_mail_settings',
187 'entity' => 'MailSettings',
188 'bao' => 'CRM_Core_BAO_MailSettings',
190 'FKClassName' => 'CRM_Core_DAO_Domain',
191 'pseudoconstant' => [
192 'table' => 'civicrm_domain',
194 'labelColumn' => 'name',
199 'type' => CRM_Utils_Type
::T_STRING
,
200 'title' => ts('Mail Settings Name'),
201 'description' => ts('name of this group of settings'),
203 'size' => CRM_Utils_Type
::HUGE
,
204 'where' => 'civicrm_mail_settings.name',
205 'table_name' => 'civicrm_mail_settings',
206 'entity' => 'MailSettings',
207 'bao' => 'CRM_Core_BAO_MailSettings',
211 'name' => 'is_default',
212 'type' => CRM_Utils_Type
::T_BOOLEAN
,
213 'title' => ts('Is Default Mail Settings?'),
214 'description' => ts('whether this is the default set of settings for this domain'),
215 'where' => 'civicrm_mail_settings.is_default',
216 'table_name' => 'civicrm_mail_settings',
217 'entity' => 'MailSettings',
218 'bao' => 'CRM_Core_BAO_MailSettings',
223 'type' => CRM_Utils_Type
::T_STRING
,
224 'title' => ts('email Domain'),
225 'description' => ts('email address domain (the part after @)'),
227 'size' => CRM_Utils_Type
::HUGE
,
228 'where' => 'civicrm_mail_settings.domain',
229 'table_name' => 'civicrm_mail_settings',
230 'entity' => 'MailSettings',
231 'bao' => 'CRM_Core_BAO_MailSettings',
235 'name' => 'localpart',
236 'type' => CRM_Utils_Type
::T_STRING
,
237 'title' => ts('email Local Part'),
238 'description' => ts('optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)'),
240 'size' => CRM_Utils_Type
::HUGE
,
241 'where' => 'civicrm_mail_settings.localpart',
242 'table_name' => 'civicrm_mail_settings',
243 'entity' => 'MailSettings',
244 'bao' => 'CRM_Core_BAO_MailSettings',
248 'name' => 'return_path',
249 'type' => CRM_Utils_Type
::T_STRING
,
250 'title' => ts('Return Path'),
251 'description' => ts('contents of the Return-Path header'),
253 'size' => CRM_Utils_Type
::HUGE
,
254 'where' => 'civicrm_mail_settings.return_path',
255 'table_name' => 'civicrm_mail_settings',
256 'entity' => 'MailSettings',
257 'bao' => 'CRM_Core_BAO_MailSettings',
261 'name' => 'protocol',
262 'type' => CRM_Utils_Type
::T_STRING
,
263 'title' => ts('Protocol'),
264 'description' => ts('name of the protocol to use for polling (like IMAP, POP3 or Maildir)'),
266 'size' => CRM_Utils_Type
::HUGE
,
267 'where' => 'civicrm_mail_settings.protocol',
268 'table_name' => 'civicrm_mail_settings',
269 'entity' => 'MailSettings',
270 'bao' => 'CRM_Core_BAO_MailSettings',
275 'pseudoconstant' => [
276 'optionGroupName' => 'mail_protocol',
277 'optionEditPath' => 'civicrm/admin/options/mail_protocol',
282 'type' => CRM_Utils_Type
::T_STRING
,
283 'title' => ts('Mail Server'),
284 'description' => ts('server to use when polling'),
286 'size' => CRM_Utils_Type
::HUGE
,
287 'where' => 'civicrm_mail_settings.server',
288 'table_name' => 'civicrm_mail_settings',
289 'entity' => 'MailSettings',
290 'bao' => 'CRM_Core_BAO_MailSettings',
295 'type' => CRM_Utils_Type
::T_INT
,
296 'title' => ts('Mail Port'),
297 'description' => ts('port to use when polling'),
298 'where' => 'civicrm_mail_settings.port',
299 'table_name' => 'civicrm_mail_settings',
300 'entity' => 'MailSettings',
301 'bao' => 'CRM_Core_BAO_MailSettings',
305 'name' => 'username',
306 'type' => CRM_Utils_Type
::T_STRING
,
307 'title' => ts('Mail Account Username'),
308 'description' => ts('username to use when polling'),
310 'size' => CRM_Utils_Type
::HUGE
,
311 'where' => 'civicrm_mail_settings.username',
312 'table_name' => 'civicrm_mail_settings',
313 'entity' => 'MailSettings',
314 'bao' => 'CRM_Core_BAO_MailSettings',
318 'name' => 'password',
319 'type' => CRM_Utils_Type
::T_STRING
,
320 'title' => ts('Mail Account Password'),
321 'description' => ts('password to use when polling'),
323 'size' => CRM_Utils_Type
::HUGE
,
324 'where' => 'civicrm_mail_settings.password',
325 'table_name' => 'civicrm_mail_settings',
326 'entity' => 'MailSettings',
327 'bao' => 'CRM_Core_BAO_MailSettings',
332 'type' => CRM_Utils_Type
::T_BOOLEAN
,
333 'title' => ts('Mail Account Uses SSL'),
334 'description' => ts('whether to use SSL or not'),
335 'where' => 'civicrm_mail_settings.is_ssl',
336 'table_name' => 'civicrm_mail_settings',
337 'entity' => 'MailSettings',
338 'bao' => 'CRM_Core_BAO_MailSettings',
343 'type' => CRM_Utils_Type
::T_STRING
,
344 'title' => ts('Mail Folder'),
345 'description' => ts('folder to poll from when using IMAP, path to poll from when using Maildir, etc.'),
347 'size' => CRM_Utils_Type
::HUGE
,
348 'where' => 'civicrm_mail_settings.source',
349 'table_name' => 'civicrm_mail_settings',
350 'entity' => 'MailSettings',
351 'bao' => 'CRM_Core_BAO_MailSettings',
354 'activity_status' => [
355 'name' => 'activity_status',
356 'type' => CRM_Utils_Type
::T_STRING
,
357 'title' => ts('Activity Status'),
358 'description' => ts('Name of status to use when creating email to activity.'),
360 'size' => CRM_Utils_Type
::HUGE
,
361 'where' => 'civicrm_mail_settings.activity_status',
362 'table_name' => 'civicrm_mail_settings',
363 'entity' => 'MailSettings',
364 'bao' => 'CRM_Core_BAO_MailSettings',
369 'pseudoconstant' => [
370 'optionGroupName' => 'activity_status',
371 'keyColumn' => 'name',
372 'optionEditPath' => 'civicrm/admin/options/activity_status',
376 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
378 return Civi
::$statics[__CLASS__
]['fields'];
382 * Return a mapping from field-name to the corresponding key (as used in fields()).
385 * Array(string $name => string $uniqueName).
387 public static function &fieldKeys() {
388 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
389 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
391 return Civi
::$statics[__CLASS__
]['fieldKeys'];
395 * Returns the names of this table
399 public static function getTableName() {
400 return self
::$_tableName;
404 * Returns if this table needs to be logged
408 public function getLog() {
413 * Returns the list of fields that can be imported
415 * @param bool $prefix
419 public static function &import($prefix = FALSE) {
420 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mail_settings', $prefix, []);
425 * Returns the list of fields that can be exported
427 * @param bool $prefix
431 public static function &export($prefix = FALSE) {
432 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mail_settings', $prefix, []);
437 * Returns the list of indices
439 * @param bool $localize
443 public static function indices($localize = TRUE) {
445 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;