Regen DAOs with new import() / export()
[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 instance to hold the field values
46 *
47 * @var array
48 */
49 static $_fields = null;
50 /**
51 * static instance to hold the keys used in $_fields for each field.
52 *
53 * @var array
54 */
55 static $_fieldKeys = null;
56 /**
57 * static instance to hold the FK relationships
58 *
59 * @var string
60 */
61 static $_links = null;
62 /**
63 * static value to see if we should log any modifications to
64 * this table in the civicrm_log table
65 *
66 * @var boolean
67 */
68 static $_log = false;
69 /**
70 * primary key
71 *
72 * @var int unsigned
73 */
74 public $id;
75 /**
76 * Which Domain is this match entry for
77 *
78 * @var int unsigned
79 */
80 public $domain_id;
81 /**
82 * name of this group of settings
83 *
84 * @var string
85 */
86 public $name;
87 /**
88 * whether this is the default set of settings for this domain
89 *
90 * @var boolean
91 */
92 public $is_default;
93 /**
94 * email address domain (the part after @)
95 *
96 * @var string
97 */
98 public $domain;
99 /**
100 * optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)
101 *
102 * @var string
103 */
104 public $localpart;
105 /**
106 * contents of the Return-Path header
107 *
108 * @var string
109 */
110 public $return_path;
111 /**
112 * name of the protocol to use for polling (like IMAP, POP3 or Maildir)
113 *
114 * @var string
115 */
116 public $protocol;
117 /**
118 * server to use when polling
119 *
120 * @var string
121 */
122 public $server;
123 /**
124 * port to use when polling
125 *
126 * @var int unsigned
127 */
128 public $port;
129 /**
130 * username to use when polling
131 *
132 * @var string
133 */
134 public $username;
135 /**
136 * password to use when polling
137 *
138 * @var string
139 */
140 public $password;
141 /**
142 * whether to use SSL or not
143 *
144 * @var boolean
145 */
146 public $is_ssl;
147 /**
148 * folder to poll from when using IMAP, path to poll from when using Maildir, etc.
149 *
150 * @var string
151 */
152 public $source;
153 /**
154 * class constructor
155 *
156 * @return civicrm_mail_settings
157 */
158 function __construct() {
159 $this->__table = 'civicrm_mail_settings';
160 parent::__construct();
161 }
162 /**
163 * Returns foreign keys and entity references
164 *
165 * @return array
166 * [CRM_Core_Reference_Interface]
167 */
168 static function getReferenceColumns() {
169 if (!self::$_links) {
170 self::$_links = static ::createReferenceColumns(__CLASS__);
171 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'domain_id', 'civicrm_domain', 'id');
172 }
173 return self::$_links;
174 }
175 /**
176 * Returns all the column names of this table
177 *
178 * @return array
179 */
180 static function &fields() {
181 if (!(self::$_fields)) {
182 self::$_fields = array(
183 'id' => array(
184 'name' => 'id',
185 'type' => CRM_Utils_Type::T_INT,
186 'title' => ts('Mail Settings ID') ,
187 'description' => 'primary key',
188 'required' => true,
189 ) ,
190 'domain_id' => array(
191 'name' => 'domain_id',
192 'type' => CRM_Utils_Type::T_INT,
193 'title' => ts('Mail Settings Domain') ,
194 'description' => 'Which Domain is this match entry for',
195 'required' => true,
196 'FKClassName' => 'CRM_Core_DAO_Domain',
197 'pseudoconstant' => array(
198 'table' => 'civicrm_domain',
199 'keyColumn' => 'id',
200 'labelColumn' => 'name',
201 )
202 ) ,
203 'name' => array(
204 'name' => 'name',
205 'type' => CRM_Utils_Type::T_STRING,
206 'title' => ts('Mail Settings Name') ,
207 'description' => 'name of this group of settings',
208 'maxlength' => 255,
209 'size' => CRM_Utils_Type::HUGE,
210 ) ,
211 'is_default' => array(
212 'name' => 'is_default',
213 'type' => CRM_Utils_Type::T_BOOLEAN,
214 'title' => ts('Is Default Mail Settings?') ,
215 'description' => 'whether this is the default set of settings for this domain',
216 ) ,
217 'domain' => array(
218 'name' => 'domain',
219 'type' => CRM_Utils_Type::T_STRING,
220 'title' => ts('email Domain') ,
221 'description' => 'email address domain (the part after @)',
222 'maxlength' => 255,
223 'size' => CRM_Utils_Type::HUGE,
224 ) ,
225 'localpart' => array(
226 'name' => 'localpart',
227 'type' => CRM_Utils_Type::T_STRING,
228 'title' => ts('email Local Part') ,
229 'description' => 'optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)',
230 'maxlength' => 255,
231 'size' => CRM_Utils_Type::HUGE,
232 ) ,
233 'return_path' => array(
234 'name' => 'return_path',
235 'type' => CRM_Utils_Type::T_STRING,
236 'title' => ts('Return Path') ,
237 'description' => 'contents of the Return-Path header',
238 'maxlength' => 255,
239 'size' => CRM_Utils_Type::HUGE,
240 ) ,
241 'protocol' => array(
242 'name' => 'protocol',
243 'type' => CRM_Utils_Type::T_STRING,
244 'title' => ts('Protocol') ,
245 'description' => 'name of the protocol to use for polling (like IMAP, POP3 or Maildir)',
246 'maxlength' => 255,
247 'size' => CRM_Utils_Type::HUGE,
248 'html' => array(
249 'type' => 'Select',
250 ) ,
251 'pseudoconstant' => array(
252 'optionGroupName' => 'mail_protocol',
253 'optionEditPath' => 'civicrm/admin/options/mail_protocol',
254 )
255 ) ,
256 'server' => array(
257 'name' => 'server',
258 'type' => CRM_Utils_Type::T_STRING,
259 'title' => ts('Mail Server') ,
260 'description' => 'server to use when polling',
261 'maxlength' => 255,
262 'size' => CRM_Utils_Type::HUGE,
263 ) ,
264 'port' => array(
265 'name' => 'port',
266 'type' => CRM_Utils_Type::T_INT,
267 'title' => ts('Mail Port') ,
268 'description' => 'port to use when polling',
269 ) ,
270 'username' => array(
271 'name' => 'username',
272 'type' => CRM_Utils_Type::T_STRING,
273 'title' => ts('Mail Account Username') ,
274 'description' => 'username to use when polling',
275 'maxlength' => 255,
276 'size' => CRM_Utils_Type::HUGE,
277 ) ,
278 'password' => array(
279 'name' => 'password',
280 'type' => CRM_Utils_Type::T_STRING,
281 'title' => ts('Mail Account Password') ,
282 'description' => 'password to use when polling',
283 'maxlength' => 255,
284 'size' => CRM_Utils_Type::HUGE,
285 ) ,
286 'is_ssl' => array(
287 'name' => 'is_ssl',
288 'type' => CRM_Utils_Type::T_BOOLEAN,
289 'title' => ts('Mail Account Uses SSL') ,
290 'description' => 'whether to use SSL or not',
291 ) ,
292 'source' => array(
293 'name' => 'source',
294 'type' => CRM_Utils_Type::T_STRING,
295 'title' => ts('Mail Folder') ,
296 'description' => 'folder to poll from when using IMAP, path to poll from when using Maildir, etc.',
297 'maxlength' => 255,
298 'size' => CRM_Utils_Type::HUGE,
299 ) ,
300 );
301 }
302 return self::$_fields;
303 }
304 /**
305 * Returns an array containing, for each field, the arary key used for that
306 * field in self::$_fields.
307 *
308 * @return array
309 */
310 static function &fieldKeys() {
311 if (!(self::$_fieldKeys)) {
312 self::$_fieldKeys = array(
313 'id' => 'id',
314 'domain_id' => 'domain_id',
315 'name' => 'name',
316 'is_default' => 'is_default',
317 'domain' => 'domain',
318 'localpart' => 'localpart',
319 'return_path' => 'return_path',
320 'protocol' => 'protocol',
321 'server' => 'server',
322 'port' => 'port',
323 'username' => 'username',
324 'password' => 'password',
325 'is_ssl' => 'is_ssl',
326 'source' => 'source',
327 );
328 }
329 return self::$_fieldKeys;
330 }
331 /**
332 * Returns the names of this table
333 *
334 * @return string
335 */
336 static function getTableName() {
337 return self::$_tableName;
338 }
339 /**
340 * Returns if this table needs to be logged
341 *
342 * @return boolean
343 */
344 function getLog() {
345 return self::$_log;
346 }
347 /**
348 * Returns the list of fields that can be imported
349 *
350 * @param bool $prefix
351 *
352 * @return array
353 */
354 static function &import($prefix = false) {
355 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mail_settings', $prefix, array());
356 return $r;
357 }
358 /**
359 * Returns the list of fields that can be exported
360 *
361 * @param bool $prefix
362 *
363 * @return array
364 */
365 static function &export($prefix = false) {
366 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mail_settings', $prefix, array());
367 return $r;
368 }
369 }