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