Merge pull request #8944 from totten/master-givi
[civicrm-core.git] / CRM / Core / DAO / MailSettings.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
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. |
13 | |
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. |
18 | |
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 +--------------------------------------------------------------------+
26 */
27 /**
28 * @package CRM
29 * @copyright CiviCRM LLC (c) 2004-2016
30 *
31 * Generated from xml/schema/CRM/Core/MailSettings.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:16f3698a9997d082948fd562d6782962)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Core_DAO_MailSettings extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_mail_settings';
44 /**
45 * static value to see if we should log any modifications to
46 * this table in the civicrm_log table
47 *
48 * @var boolean
49 */
50 static $_log = false;
51 /**
52 * primary key
53 *
54 * @var int unsigned
55 */
56 public $id;
57 /**
58 * Which Domain is this match entry for
59 *
60 * @var int unsigned
61 */
62 public $domain_id;
63 /**
64 * name of this group of settings
65 *
66 * @var string
67 */
68 public $name;
69 /**
70 * whether this is the default set of settings for this domain
71 *
72 * @var boolean
73 */
74 public $is_default;
75 /**
76 * email address domain (the part after @)
77 *
78 * @var string
79 */
80 public $domain;
81 /**
82 * optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)
83 *
84 * @var string
85 */
86 public $localpart;
87 /**
88 * contents of the Return-Path header
89 *
90 * @var string
91 */
92 public $return_path;
93 /**
94 * name of the protocol to use for polling (like IMAP, POP3 or Maildir)
95 *
96 * @var string
97 */
98 public $protocol;
99 /**
100 * server to use when polling
101 *
102 * @var string
103 */
104 public $server;
105 /**
106 * port to use when polling
107 *
108 * @var int unsigned
109 */
110 public $port;
111 /**
112 * username to use when polling
113 *
114 * @var string
115 */
116 public $username;
117 /**
118 * password to use when polling
119 *
120 * @var string
121 */
122 public $password;
123 /**
124 * whether to use SSL or not
125 *
126 * @var boolean
127 */
128 public $is_ssl;
129 /**
130 * folder to poll from when using IMAP, path to poll from when using Maildir, etc.
131 *
132 * @var string
133 */
134 public $source;
135 /**
136 * class constructor
137 *
138 * @return civicrm_mail_settings
139 */
140 function __construct() {
141 $this->__table = 'civicrm_mail_settings';
142 parent::__construct();
143 }
144 /**
145 * Returns foreign keys and entity references
146 *
147 * @return array
148 * [CRM_Core_Reference_Interface]
149 */
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']);
155 }
156 return Civi::$statics[__CLASS__]['links'];
157 }
158 /**
159 * Returns all the column names of this table
160 *
161 * @return array
162 */
163 static function &fields() {
164 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
165 Civi::$statics[__CLASS__]['fields'] = array(
166 'id' => array(
167 'name' => 'id',
168 'type' => CRM_Utils_Type::T_INT,
169 'title' => ts('Mail Settings ID') ,
170 'description' => 'primary key',
171 'required' => true,
172 ) ,
173 'domain_id' => array(
174 'name' => 'domain_id',
175 'type' => CRM_Utils_Type::T_INT,
176 'title' => ts('Mail Settings Domain') ,
177 'description' => 'Which Domain is this match entry for',
178 'required' => true,
179 'FKClassName' => 'CRM_Core_DAO_Domain',
180 'pseudoconstant' => array(
181 'table' => 'civicrm_domain',
182 'keyColumn' => 'id',
183 'labelColumn' => 'name',
184 )
185 ) ,
186 'name' => array(
187 'name' => 'name',
188 'type' => CRM_Utils_Type::T_STRING,
189 'title' => ts('Mail Settings Name') ,
190 'description' => 'name of this group of settings',
191 'maxlength' => 255,
192 'size' => CRM_Utils_Type::HUGE,
193 ) ,
194 'is_default' => array(
195 'name' => 'is_default',
196 'type' => CRM_Utils_Type::T_BOOLEAN,
197 'title' => ts('Is Default Mail Settings?') ,
198 'description' => 'whether this is the default set of settings for this domain',
199 ) ,
200 'domain' => array(
201 'name' => 'domain',
202 'type' => CRM_Utils_Type::T_STRING,
203 'title' => ts('email Domain') ,
204 'description' => 'email address domain (the part after @)',
205 'maxlength' => 255,
206 'size' => CRM_Utils_Type::HUGE,
207 ) ,
208 'localpart' => array(
209 'name' => 'localpart',
210 'type' => CRM_Utils_Type::T_STRING,
211 'title' => ts('email Local Part') ,
212 'description' => 'optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)',
213 'maxlength' => 255,
214 'size' => CRM_Utils_Type::HUGE,
215 ) ,
216 'return_path' => array(
217 'name' => 'return_path',
218 'type' => CRM_Utils_Type::T_STRING,
219 'title' => ts('Return Path') ,
220 'description' => 'contents of the Return-Path header',
221 'maxlength' => 255,
222 'size' => CRM_Utils_Type::HUGE,
223 ) ,
224 'protocol' => array(
225 'name' => 'protocol',
226 'type' => CRM_Utils_Type::T_STRING,
227 'title' => ts('Protocol') ,
228 'description' => 'name of the protocol to use for polling (like IMAP, POP3 or Maildir)',
229 'maxlength' => 255,
230 'size' => CRM_Utils_Type::HUGE,
231 'html' => array(
232 'type' => 'Select',
233 ) ,
234 'pseudoconstant' => array(
235 'optionGroupName' => 'mail_protocol',
236 'optionEditPath' => 'civicrm/admin/options/mail_protocol',
237 )
238 ) ,
239 'server' => array(
240 'name' => 'server',
241 'type' => CRM_Utils_Type::T_STRING,
242 'title' => ts('Mail Server') ,
243 'description' => 'server to use when polling',
244 'maxlength' => 255,
245 'size' => CRM_Utils_Type::HUGE,
246 ) ,
247 'port' => array(
248 'name' => 'port',
249 'type' => CRM_Utils_Type::T_INT,
250 'title' => ts('Mail Port') ,
251 'description' => 'port to use when polling',
252 ) ,
253 'username' => array(
254 'name' => 'username',
255 'type' => CRM_Utils_Type::T_STRING,
256 'title' => ts('Mail Account Username') ,
257 'description' => 'username to use when polling',
258 'maxlength' => 255,
259 'size' => CRM_Utils_Type::HUGE,
260 ) ,
261 'password' => array(
262 'name' => 'password',
263 'type' => CRM_Utils_Type::T_STRING,
264 'title' => ts('Mail Account Password') ,
265 'description' => 'password to use when polling',
266 'maxlength' => 255,
267 'size' => CRM_Utils_Type::HUGE,
268 ) ,
269 'is_ssl' => array(
270 'name' => 'is_ssl',
271 'type' => CRM_Utils_Type::T_BOOLEAN,
272 'title' => ts('Mail Account Uses SSL') ,
273 'description' => 'whether to use SSL or not',
274 ) ,
275 'source' => array(
276 'name' => 'source',
277 'type' => CRM_Utils_Type::T_STRING,
278 'title' => ts('Mail Folder') ,
279 'description' => 'folder to poll from when using IMAP, path to poll from when using Maildir, etc.',
280 'maxlength' => 255,
281 'size' => CRM_Utils_Type::HUGE,
282 ) ,
283 );
284 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
285 }
286 return Civi::$statics[__CLASS__]['fields'];
287 }
288 /**
289 * Return a mapping from field-name to the corresponding key (as used in fields()).
290 *
291 * @return array
292 * Array(string $name => string $uniqueName).
293 */
294 static function &fieldKeys() {
295 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
296 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
297 }
298 return Civi::$statics[__CLASS__]['fieldKeys'];
299 }
300 /**
301 * Returns the names of this table
302 *
303 * @return string
304 */
305 static function getTableName() {
306 return self::$_tableName;
307 }
308 /**
309 * Returns if this table needs to be logged
310 *
311 * @return boolean
312 */
313 function getLog() {
314 return self::$_log;
315 }
316 /**
317 * Returns the list of fields that can be imported
318 *
319 * @param bool $prefix
320 *
321 * @return array
322 */
323 static function &import($prefix = false) {
324 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mail_settings', $prefix, array());
325 return $r;
326 }
327 /**
328 * Returns the list of fields that can be exported
329 *
330 * @param bool $prefix
331 *
332 * @return array
333 */
334 static function &export($prefix = false) {
335 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mail_settings', $prefix, array());
336 return $r;
337 }
338 }