3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2017 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
29 * @copyright CiviCRM LLC (c) 2004-2017
31 * Generated from xml/schema/CRM/Core/MailSettings.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:739e36d6ca1f8572f5f9eff77975765e)
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
38 * CRM_Core_DAO_MailSettings constructor.
40 class CRM_Core_DAO_MailSettings
extends CRM_Core_DAO
{
42 * Static instance to hold the table name.
46 static $_tableName = 'civicrm_mail_settings';
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
60 * Which Domain is this match entry for
66 * name of this group of settings
72 * whether this is the default set of settings for this domain
78 * email address domain (the part after @)
84 * optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)
90 * contents of the Return-Path header
96 * name of the protocol to use for polling (like IMAP, POP3 or Maildir)
102 * server to use when polling
108 * port to use when polling
114 * username to use when polling
120 * password to use when polling
126 * whether to use SSL or not
132 * folder to poll from when using IMAP, path to poll from when using Maildir, etc.
140 function __construct() {
141 $this->__table
= 'civicrm_mail_settings';
142 parent
::__construct();
145 * Returns foreign keys and entity references.
148 * [CRM_Core_Reference_Interface]
150 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'];
159 * Returns all the column names of this table
163 static function &fields() {
164 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
165 Civi
::$statics[__CLASS__
]['fields'] = array(
168 'type' => CRM_Utils_Type
::T_INT
,
169 'title' => ts('Mail Settings ID') ,
170 'description' => 'primary key',
172 'table_name' => 'civicrm_mail_settings',
173 'entity' => 'MailSettings',
174 'bao' => 'CRM_Core_BAO_MailSettings',
177 'domain_id' => array(
178 'name' => 'domain_id',
179 'type' => CRM_Utils_Type
::T_INT
,
180 'title' => ts('Mail Settings Domain') ,
181 'description' => 'Which Domain is this match entry for',
183 'table_name' => 'civicrm_mail_settings',
184 'entity' => 'MailSettings',
185 'bao' => 'CRM_Core_BAO_MailSettings',
187 'FKClassName' => 'CRM_Core_DAO_Domain',
188 'pseudoconstant' => array(
189 'table' => 'civicrm_domain',
191 'labelColumn' => 'name',
196 'type' => CRM_Utils_Type
::T_STRING
,
197 'title' => ts('Mail Settings Name') ,
198 'description' => 'name of this group of settings',
200 'size' => CRM_Utils_Type
::HUGE
,
201 'table_name' => 'civicrm_mail_settings',
202 'entity' => 'MailSettings',
203 'bao' => 'CRM_Core_BAO_MailSettings',
206 'is_default' => array(
207 'name' => 'is_default',
208 'type' => CRM_Utils_Type
::T_BOOLEAN
,
209 'title' => ts('Is Default Mail Settings?') ,
210 'description' => 'whether this is the default set of settings for this domain',
211 'table_name' => 'civicrm_mail_settings',
212 'entity' => 'MailSettings',
213 'bao' => 'CRM_Core_BAO_MailSettings',
218 'type' => CRM_Utils_Type
::T_STRING
,
219 'title' => ts('email Domain') ,
220 'description' => 'email address domain (the part after @)',
222 'size' => CRM_Utils_Type
::HUGE
,
223 'table_name' => 'civicrm_mail_settings',
224 'entity' => 'MailSettings',
225 'bao' => 'CRM_Core_BAO_MailSettings',
228 'localpart' => array(
229 'name' => 'localpart',
230 'type' => CRM_Utils_Type
::T_STRING
,
231 'title' => ts('email Local Part') ,
232 'description' => 'optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)',
234 'size' => CRM_Utils_Type
::HUGE
,
235 'table_name' => 'civicrm_mail_settings',
236 'entity' => 'MailSettings',
237 'bao' => 'CRM_Core_BAO_MailSettings',
240 'return_path' => array(
241 'name' => 'return_path',
242 'type' => CRM_Utils_Type
::T_STRING
,
243 'title' => ts('Return Path') ,
244 'description' => 'contents of the Return-Path header',
246 'size' => CRM_Utils_Type
::HUGE
,
247 'table_name' => 'civicrm_mail_settings',
248 'entity' => 'MailSettings',
249 'bao' => 'CRM_Core_BAO_MailSettings',
253 'name' => 'protocol',
254 'type' => CRM_Utils_Type
::T_STRING
,
255 'title' => ts('Protocol') ,
256 'description' => 'name of the protocol to use for polling (like IMAP, POP3 or Maildir)',
258 'size' => CRM_Utils_Type
::HUGE
,
259 'table_name' => 'civicrm_mail_settings',
260 'entity' => 'MailSettings',
261 'bao' => 'CRM_Core_BAO_MailSettings',
266 'pseudoconstant' => array(
267 'optionGroupName' => 'mail_protocol',
268 'optionEditPath' => 'civicrm/admin/options/mail_protocol',
273 'type' => CRM_Utils_Type
::T_STRING
,
274 'title' => ts('Mail Server') ,
275 'description' => 'server to use when polling',
277 'size' => CRM_Utils_Type
::HUGE
,
278 'table_name' => 'civicrm_mail_settings',
279 'entity' => 'MailSettings',
280 'bao' => 'CRM_Core_BAO_MailSettings',
285 'type' => CRM_Utils_Type
::T_INT
,
286 'title' => ts('Mail Port') ,
287 'description' => 'port to use when polling',
288 'table_name' => 'civicrm_mail_settings',
289 'entity' => 'MailSettings',
290 'bao' => 'CRM_Core_BAO_MailSettings',
294 'name' => 'username',
295 'type' => CRM_Utils_Type
::T_STRING
,
296 'title' => ts('Mail Account Username') ,
297 'description' => 'username to use when polling',
299 'size' => CRM_Utils_Type
::HUGE
,
300 'table_name' => 'civicrm_mail_settings',
301 'entity' => 'MailSettings',
302 'bao' => 'CRM_Core_BAO_MailSettings',
306 'name' => 'password',
307 'type' => CRM_Utils_Type
::T_STRING
,
308 'title' => ts('Mail Account Password') ,
309 'description' => 'password to use when polling',
311 'size' => CRM_Utils_Type
::HUGE
,
312 'table_name' => 'civicrm_mail_settings',
313 'entity' => 'MailSettings',
314 'bao' => 'CRM_Core_BAO_MailSettings',
319 'type' => CRM_Utils_Type
::T_BOOLEAN
,
320 'title' => ts('Mail Account Uses SSL') ,
321 'description' => 'whether to use SSL or not',
322 'table_name' => 'civicrm_mail_settings',
323 'entity' => 'MailSettings',
324 'bao' => 'CRM_Core_BAO_MailSettings',
329 'type' => CRM_Utils_Type
::T_STRING
,
330 'title' => ts('Mail Folder') ,
331 'description' => 'folder to poll from when using IMAP, path to poll from when using Maildir, etc.',
333 'size' => CRM_Utils_Type
::HUGE
,
334 'table_name' => 'civicrm_mail_settings',
335 'entity' => 'MailSettings',
336 'bao' => 'CRM_Core_BAO_MailSettings',
340 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
342 return Civi
::$statics[__CLASS__
]['fields'];
345 * Return a mapping from field-name to the corresponding key (as used in fields()).
348 * Array(string $name => string $uniqueName).
350 static function &fieldKeys() {
351 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
352 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
354 return Civi
::$statics[__CLASS__
]['fieldKeys'];
357 * Returns the names of this table
361 static function getTableName() {
362 return self
::$_tableName;
365 * Returns if this table needs to be logged
373 * Returns the list of fields that can be imported
375 * @param bool $prefix
379 static function &import($prefix = false) {
380 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mail_settings', $prefix, array());
384 * Returns the list of fields that can be exported
386 * @param bool $prefix
390 static function &export($prefix = false) {
391 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mail_settings', $prefix, array());
395 * Returns the list of indices
397 public static function indices($localize = TRUE) {
399 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;