5 * @copyright CiviCRM LLC (c) 2004-2017
7 * Generated from xml/schema/CRM/Core/MailSettings.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:86515d7cb55425fbad3a71d5aa000af0)
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 static $_tableName = 'civicrm_mail_settings';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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' => 'primary key',
173 'table_name' => 'civicrm_mail_settings',
174 'entity' => 'MailSettings',
175 'bao' => 'CRM_Core_BAO_MailSettings',
179 'name' => 'domain_id',
180 'type' => CRM_Utils_Type
::T_INT
,
181 'title' => ts('Mail Settings Domain'),
182 'description' => 'Which Domain is this match entry for',
184 'table_name' => 'civicrm_mail_settings',
185 'entity' => 'MailSettings',
186 'bao' => 'CRM_Core_BAO_MailSettings',
188 'FKClassName' => 'CRM_Core_DAO_Domain',
189 'pseudoconstant' => [
190 'table' => 'civicrm_domain',
192 'labelColumn' => 'name',
197 'type' => CRM_Utils_Type
::T_STRING
,
198 'title' => ts('Mail Settings Name'),
199 'description' => 'name of this group of settings',
201 'size' => CRM_Utils_Type
::HUGE
,
202 'table_name' => 'civicrm_mail_settings',
203 'entity' => 'MailSettings',
204 'bao' => 'CRM_Core_BAO_MailSettings',
208 'name' => 'is_default',
209 'type' => CRM_Utils_Type
::T_BOOLEAN
,
210 'title' => ts('Is Default Mail Settings?'),
211 'description' => 'whether this is the default set of settings for this domain',
212 'table_name' => 'civicrm_mail_settings',
213 'entity' => 'MailSettings',
214 'bao' => 'CRM_Core_BAO_MailSettings',
219 'type' => CRM_Utils_Type
::T_STRING
,
220 'title' => ts('email Domain'),
221 'description' => 'email address domain (the part after @)',
223 'size' => CRM_Utils_Type
::HUGE
,
224 'table_name' => 'civicrm_mail_settings',
225 'entity' => 'MailSettings',
226 'bao' => 'CRM_Core_BAO_MailSettings',
230 'name' => 'localpart',
231 'type' => CRM_Utils_Type
::T_STRING
,
232 'title' => ts('email Local Part'),
233 'description' => 'optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)',
235 'size' => CRM_Utils_Type
::HUGE
,
236 'table_name' => 'civicrm_mail_settings',
237 'entity' => 'MailSettings',
238 'bao' => 'CRM_Core_BAO_MailSettings',
242 'name' => 'return_path',
243 'type' => CRM_Utils_Type
::T_STRING
,
244 'title' => ts('Return Path'),
245 'description' => 'contents of the Return-Path header',
247 'size' => CRM_Utils_Type
::HUGE
,
248 'table_name' => 'civicrm_mail_settings',
249 'entity' => 'MailSettings',
250 'bao' => 'CRM_Core_BAO_MailSettings',
254 'name' => 'protocol',
255 'type' => CRM_Utils_Type
::T_STRING
,
256 'title' => ts('Protocol'),
257 'description' => 'name of the protocol to use for polling (like IMAP, POP3 or Maildir)',
259 'size' => CRM_Utils_Type
::HUGE
,
260 'table_name' => 'civicrm_mail_settings',
261 'entity' => 'MailSettings',
262 'bao' => 'CRM_Core_BAO_MailSettings',
267 'pseudoconstant' => [
268 'optionGroupName' => 'mail_protocol',
269 'optionEditPath' => 'civicrm/admin/options/mail_protocol',
274 'type' => CRM_Utils_Type
::T_STRING
,
275 'title' => ts('Mail Server'),
276 'description' => 'server to use when polling',
278 'size' => CRM_Utils_Type
::HUGE
,
279 'table_name' => 'civicrm_mail_settings',
280 'entity' => 'MailSettings',
281 'bao' => 'CRM_Core_BAO_MailSettings',
286 'type' => CRM_Utils_Type
::T_INT
,
287 'title' => ts('Mail Port'),
288 'description' => 'port to use when polling',
289 'table_name' => 'civicrm_mail_settings',
290 'entity' => 'MailSettings',
291 'bao' => 'CRM_Core_BAO_MailSettings',
295 'name' => 'username',
296 'type' => CRM_Utils_Type
::T_STRING
,
297 'title' => ts('Mail Account Username'),
298 'description' => 'username to use when polling',
300 'size' => CRM_Utils_Type
::HUGE
,
301 'table_name' => 'civicrm_mail_settings',
302 'entity' => 'MailSettings',
303 'bao' => 'CRM_Core_BAO_MailSettings',
307 'name' => 'password',
308 'type' => CRM_Utils_Type
::T_STRING
,
309 'title' => ts('Mail Account Password'),
310 'description' => 'password to use when polling',
312 'size' => CRM_Utils_Type
::HUGE
,
313 'table_name' => 'civicrm_mail_settings',
314 'entity' => 'MailSettings',
315 'bao' => 'CRM_Core_BAO_MailSettings',
320 'type' => CRM_Utils_Type
::T_BOOLEAN
,
321 'title' => ts('Mail Account Uses SSL'),
322 'description' => 'whether to use SSL or not',
323 'table_name' => 'civicrm_mail_settings',
324 'entity' => 'MailSettings',
325 'bao' => 'CRM_Core_BAO_MailSettings',
330 'type' => CRM_Utils_Type
::T_STRING
,
331 'title' => ts('Mail Folder'),
332 'description' => 'folder to poll from when using IMAP, path to poll from when using Maildir, etc.',
334 'size' => CRM_Utils_Type
::HUGE
,
335 'table_name' => 'civicrm_mail_settings',
336 'entity' => 'MailSettings',
337 'bao' => 'CRM_Core_BAO_MailSettings',
340 'activity_status' => [
341 'name' => 'activity_status',
342 'type' => CRM_Utils_Type
::T_STRING
,
343 'title' => ts('Activity Status'),
344 'description' => 'Name of status to use when creating email to activity.',
346 'size' => CRM_Utils_Type
::HUGE
,
347 'table_name' => 'civicrm_mail_settings',
348 'entity' => 'MailSettings',
349 'bao' => 'CRM_Core_BAO_MailSettings',
354 'pseudoconstant' => [
355 'optionGroupName' => 'activity_status',
356 'keyColumn' => 'name',
357 'optionEditPath' => 'civicrm/admin/options/activity_status',
361 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
363 return Civi
::$statics[__CLASS__
]['fields'];
367 * Return a mapping from field-name to the corresponding key (as used in fields()).
370 * Array(string $name => string $uniqueName).
372 public static function &fieldKeys() {
373 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
374 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
376 return Civi
::$statics[__CLASS__
]['fieldKeys'];
380 * Returns the names of this table
384 public static function getTableName() {
385 return self
::$_tableName;
389 * Returns if this table needs to be logged
393 public function getLog() {
398 * Returns the list of fields that can be imported
400 * @param bool $prefix
404 public static function &import($prefix = FALSE) {
405 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mail_settings', $prefix, []);
410 * Returns the list of fields that can be exported
412 * @param bool $prefix
416 public static function &export($prefix = FALSE) {
417 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mail_settings', $prefix, []);
422 * Returns the list of indices
424 * @param bool $localize
428 public static function indices($localize = TRUE) {
430 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;