Merge pull request #14276 from eileenmcnaughton/dbunit_2
[civicrm-core.git] / CRM / Core / DAO / MailSettings.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2019
6 *
7 * Generated from xml/schema/CRM/Core/MailSettings.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:c33c35b1229f918de332c6287318196a)
10 */
11
12 /**
13 * Database access object for the MailSettings entity.
14 */
15 class CRM_Core_DAO_MailSettings extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 public static $_tableName = 'civicrm_mail_settings';
23
24 /**
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
26 *
27 * @var bool
28 */
29 public static $_log = FALSE;
30
31 /**
32 * primary key
33 *
34 * @var int unsigned
35 */
36 public $id;
37
38 /**
39 * Which Domain is this match entry for
40 *
41 * @var int unsigned
42 */
43 public $domain_id;
44
45 /**
46 * name of this group of settings
47 *
48 * @var string
49 */
50 public $name;
51
52 /**
53 * whether this is the default set of settings for this domain
54 *
55 * @var boolean
56 */
57 public $is_default;
58
59 /**
60 * email address domain (the part after @)
61 *
62 * @var string
63 */
64 public $domain;
65
66 /**
67 * optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)
68 *
69 * @var string
70 */
71 public $localpart;
72
73 /**
74 * contents of the Return-Path header
75 *
76 * @var string
77 */
78 public $return_path;
79
80 /**
81 * name of the protocol to use for polling (like IMAP, POP3 or Maildir)
82 *
83 * @var string
84 */
85 public $protocol;
86
87 /**
88 * server to use when polling
89 *
90 * @var string
91 */
92 public $server;
93
94 /**
95 * port to use when polling
96 *
97 * @var int unsigned
98 */
99 public $port;
100
101 /**
102 * username to use when polling
103 *
104 * @var string
105 */
106 public $username;
107
108 /**
109 * password to use when polling
110 *
111 * @var string
112 */
113 public $password;
114
115 /**
116 * whether to use SSL or not
117 *
118 * @var boolean
119 */
120 public $is_ssl;
121
122 /**
123 * folder to poll from when using IMAP, path to poll from when using Maildir, etc.
124 *
125 * @var string
126 */
127 public $source;
128
129 /**
130 * Name of status to use when creating email to activity.
131 *
132 * @var string
133 */
134 public $activity_status;
135
136 /**
137 * Class constructor.
138 */
139 public function __construct() {
140 $this->__table = 'civicrm_mail_settings';
141 parent::__construct();
142 }
143
144 /**
145 * Returns foreign keys and entity references.
146 *
147 * @return array
148 * [CRM_Core_Reference_Interface]
149 */
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']);
155 }
156 return Civi::$statics[__CLASS__]['links'];
157 }
158
159 /**
160 * Returns all the column names of this table
161 *
162 * @return array
163 */
164 public static function &fields() {
165 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
166 Civi::$statics[__CLASS__]['fields'] = [
167 'id' => [
168 'name' => 'id',
169 'type' => CRM_Utils_Type::T_INT,
170 'title' => ts('Mail Settings ID'),
171 'description' => ts('primary key'),
172 'required' => TRUE,
173 'where' => 'civicrm_mail_settings.id',
174 'table_name' => 'civicrm_mail_settings',
175 'entity' => 'MailSettings',
176 'bao' => 'CRM_Core_BAO_MailSettings',
177 'localizable' => 0,
178 ],
179 'domain_id' => [
180 'name' => 'domain_id',
181 'type' => CRM_Utils_Type::T_INT,
182 'title' => ts('Mail Settings Domain'),
183 'description' => ts('Which Domain is this match entry for'),
184 'required' => TRUE,
185 'where' => 'civicrm_mail_settings.domain_id',
186 'table_name' => 'civicrm_mail_settings',
187 'entity' => 'MailSettings',
188 'bao' => 'CRM_Core_BAO_MailSettings',
189 'localizable' => 0,
190 'FKClassName' => 'CRM_Core_DAO_Domain',
191 'pseudoconstant' => [
192 'table' => 'civicrm_domain',
193 'keyColumn' => 'id',
194 'labelColumn' => 'name',
195 ]
196 ],
197 'name' => [
198 'name' => 'name',
199 'type' => CRM_Utils_Type::T_STRING,
200 'title' => ts('Mail Settings Name'),
201 'description' => ts('name of this group of settings'),
202 'maxlength' => 255,
203 'size' => CRM_Utils_Type::HUGE,
204 'where' => 'civicrm_mail_settings.name',
205 'table_name' => 'civicrm_mail_settings',
206 'entity' => 'MailSettings',
207 'bao' => 'CRM_Core_BAO_MailSettings',
208 'localizable' => 0,
209 ],
210 'is_default' => [
211 'name' => 'is_default',
212 'type' => CRM_Utils_Type::T_BOOLEAN,
213 'title' => ts('Is Default Mail Settings?'),
214 'description' => ts('whether this is the default set of settings for this domain'),
215 'where' => 'civicrm_mail_settings.is_default',
216 'table_name' => 'civicrm_mail_settings',
217 'entity' => 'MailSettings',
218 'bao' => 'CRM_Core_BAO_MailSettings',
219 'localizable' => 0,
220 ],
221 'domain' => [
222 'name' => 'domain',
223 'type' => CRM_Utils_Type::T_STRING,
224 'title' => ts('email Domain'),
225 'description' => ts('email address domain (the part after @)'),
226 'maxlength' => 255,
227 'size' => CRM_Utils_Type::HUGE,
228 'where' => 'civicrm_mail_settings.domain',
229 'table_name' => 'civicrm_mail_settings',
230 'entity' => 'MailSettings',
231 'bao' => 'CRM_Core_BAO_MailSettings',
232 'localizable' => 0,
233 ],
234 'localpart' => [
235 'name' => 'localpart',
236 'type' => CRM_Utils_Type::T_STRING,
237 'title' => ts('email Local Part'),
238 'description' => ts('optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)'),
239 'maxlength' => 255,
240 'size' => CRM_Utils_Type::HUGE,
241 'where' => 'civicrm_mail_settings.localpart',
242 'table_name' => 'civicrm_mail_settings',
243 'entity' => 'MailSettings',
244 'bao' => 'CRM_Core_BAO_MailSettings',
245 'localizable' => 0,
246 ],
247 'return_path' => [
248 'name' => 'return_path',
249 'type' => CRM_Utils_Type::T_STRING,
250 'title' => ts('Return Path'),
251 'description' => ts('contents of the Return-Path header'),
252 'maxlength' => 255,
253 'size' => CRM_Utils_Type::HUGE,
254 'where' => 'civicrm_mail_settings.return_path',
255 'table_name' => 'civicrm_mail_settings',
256 'entity' => 'MailSettings',
257 'bao' => 'CRM_Core_BAO_MailSettings',
258 'localizable' => 0,
259 ],
260 'protocol' => [
261 'name' => 'protocol',
262 'type' => CRM_Utils_Type::T_STRING,
263 'title' => ts('Protocol'),
264 'description' => ts('name of the protocol to use for polling (like IMAP, POP3 or Maildir)'),
265 'maxlength' => 255,
266 'size' => CRM_Utils_Type::HUGE,
267 'where' => 'civicrm_mail_settings.protocol',
268 'table_name' => 'civicrm_mail_settings',
269 'entity' => 'MailSettings',
270 'bao' => 'CRM_Core_BAO_MailSettings',
271 'localizable' => 0,
272 'html' => [
273 'type' => 'Select',
274 ],
275 'pseudoconstant' => [
276 'optionGroupName' => 'mail_protocol',
277 'optionEditPath' => 'civicrm/admin/options/mail_protocol',
278 ]
279 ],
280 'server' => [
281 'name' => 'server',
282 'type' => CRM_Utils_Type::T_STRING,
283 'title' => ts('Mail Server'),
284 'description' => ts('server to use when polling'),
285 'maxlength' => 255,
286 'size' => CRM_Utils_Type::HUGE,
287 'where' => 'civicrm_mail_settings.server',
288 'table_name' => 'civicrm_mail_settings',
289 'entity' => 'MailSettings',
290 'bao' => 'CRM_Core_BAO_MailSettings',
291 'localizable' => 0,
292 ],
293 'port' => [
294 'name' => 'port',
295 'type' => CRM_Utils_Type::T_INT,
296 'title' => ts('Mail Port'),
297 'description' => ts('port to use when polling'),
298 'where' => 'civicrm_mail_settings.port',
299 'table_name' => 'civicrm_mail_settings',
300 'entity' => 'MailSettings',
301 'bao' => 'CRM_Core_BAO_MailSettings',
302 'localizable' => 0,
303 ],
304 'username' => [
305 'name' => 'username',
306 'type' => CRM_Utils_Type::T_STRING,
307 'title' => ts('Mail Account Username'),
308 'description' => ts('username to use when polling'),
309 'maxlength' => 255,
310 'size' => CRM_Utils_Type::HUGE,
311 'where' => 'civicrm_mail_settings.username',
312 'table_name' => 'civicrm_mail_settings',
313 'entity' => 'MailSettings',
314 'bao' => 'CRM_Core_BAO_MailSettings',
315 'localizable' => 0,
316 ],
317 'password' => [
318 'name' => 'password',
319 'type' => CRM_Utils_Type::T_STRING,
320 'title' => ts('Mail Account Password'),
321 'description' => ts('password to use when polling'),
322 'maxlength' => 255,
323 'size' => CRM_Utils_Type::HUGE,
324 'where' => 'civicrm_mail_settings.password',
325 'table_name' => 'civicrm_mail_settings',
326 'entity' => 'MailSettings',
327 'bao' => 'CRM_Core_BAO_MailSettings',
328 'localizable' => 0,
329 ],
330 'is_ssl' => [
331 'name' => 'is_ssl',
332 'type' => CRM_Utils_Type::T_BOOLEAN,
333 'title' => ts('Mail Account Uses SSL'),
334 'description' => ts('whether to use SSL or not'),
335 'where' => 'civicrm_mail_settings.is_ssl',
336 'table_name' => 'civicrm_mail_settings',
337 'entity' => 'MailSettings',
338 'bao' => 'CRM_Core_BAO_MailSettings',
339 'localizable' => 0,
340 ],
341 'source' => [
342 'name' => 'source',
343 'type' => CRM_Utils_Type::T_STRING,
344 'title' => ts('Mail Folder'),
345 'description' => ts('folder to poll from when using IMAP, path to poll from when using Maildir, etc.'),
346 'maxlength' => 255,
347 'size' => CRM_Utils_Type::HUGE,
348 'where' => 'civicrm_mail_settings.source',
349 'table_name' => 'civicrm_mail_settings',
350 'entity' => 'MailSettings',
351 'bao' => 'CRM_Core_BAO_MailSettings',
352 'localizable' => 0,
353 ],
354 'activity_status' => [
355 'name' => 'activity_status',
356 'type' => CRM_Utils_Type::T_STRING,
357 'title' => ts('Activity Status'),
358 'description' => ts('Name of status to use when creating email to activity.'),
359 'maxlength' => 255,
360 'size' => CRM_Utils_Type::HUGE,
361 'where' => 'civicrm_mail_settings.activity_status',
362 'table_name' => 'civicrm_mail_settings',
363 'entity' => 'MailSettings',
364 'bao' => 'CRM_Core_BAO_MailSettings',
365 'localizable' => 0,
366 'html' => [
367 'type' => 'Select',
368 ],
369 'pseudoconstant' => [
370 'optionGroupName' => 'activity_status',
371 'keyColumn' => 'name',
372 'optionEditPath' => 'civicrm/admin/options/activity_status',
373 ]
374 ],
375 ];
376 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
377 }
378 return Civi::$statics[__CLASS__]['fields'];
379 }
380
381 /**
382 * Return a mapping from field-name to the corresponding key (as used in fields()).
383 *
384 * @return array
385 * Array(string $name => string $uniqueName).
386 */
387 public static function &fieldKeys() {
388 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
389 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
390 }
391 return Civi::$statics[__CLASS__]['fieldKeys'];
392 }
393
394 /**
395 * Returns the names of this table
396 *
397 * @return string
398 */
399 public static function getTableName() {
400 return self::$_tableName;
401 }
402
403 /**
404 * Returns if this table needs to be logged
405 *
406 * @return bool
407 */
408 public function getLog() {
409 return self::$_log;
410 }
411
412 /**
413 * Returns the list of fields that can be imported
414 *
415 * @param bool $prefix
416 *
417 * @return array
418 */
419 public static function &import($prefix = FALSE) {
420 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mail_settings', $prefix, []);
421 return $r;
422 }
423
424 /**
425 * Returns the list of fields that can be exported
426 *
427 * @param bool $prefix
428 *
429 * @return array
430 */
431 public static function &export($prefix = FALSE) {
432 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mail_settings', $prefix, []);
433 return $r;
434 }
435
436 /**
437 * Returns the list of indices
438 *
439 * @param bool $localize
440 *
441 * @return array
442 */
443 public static function indices($localize = TRUE) {
444 $indices = [];
445 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
446 }
447
448 }