API/DAO Metadata - Retain versioning metadata for possible usage in runtime+tooling
[civicrm-core.git] / CRM / Core / DAO / MailSettings.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Core/MailSettings.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:455750fee6f1acbe50aeb19387f12158)
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
35 */
36 public $id;
37
38 /**
39 * Which Domain is this match entry for
40 *
41 * @var int
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 bool
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
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 bool
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 localized title of this entity.
146 */
147 public static function getEntityTitle() {
148 return ts('Mail Settingses');
149 }
150
151 /**
152 * Returns foreign keys and entity references.
153 *
154 * @return array
155 * [CRM_Core_Reference_Interface]
156 */
157 public static function getReferenceColumns() {
158 if (!isset(Civi::$statics[__CLASS__]['links'])) {
159 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
160 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'domain_id', 'civicrm_domain', 'id');
161 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
162 }
163 return Civi::$statics[__CLASS__]['links'];
164 }
165
166 /**
167 * Returns all the column names of this table
168 *
169 * @return array
170 */
171 public static function &fields() {
172 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
173 Civi::$statics[__CLASS__]['fields'] = [
174 'id' => [
175 'name' => 'id',
176 'type' => CRM_Utils_Type::T_INT,
177 'title' => ts('Mail Settings ID'),
178 'description' => ts('primary key'),
179 'required' => TRUE,
180 'where' => 'civicrm_mail_settings.id',
181 'table_name' => 'civicrm_mail_settings',
182 'entity' => 'MailSettings',
183 'bao' => 'CRM_Core_BAO_MailSettings',
184 'localizable' => 0,
185 'add' => '2.2',
186 ],
187 'domain_id' => [
188 'name' => 'domain_id',
189 'type' => CRM_Utils_Type::T_INT,
190 'title' => ts('Mail Settings Domain'),
191 'description' => ts('Which Domain is this match entry for'),
192 'required' => TRUE,
193 'where' => 'civicrm_mail_settings.domain_id',
194 'table_name' => 'civicrm_mail_settings',
195 'entity' => 'MailSettings',
196 'bao' => 'CRM_Core_BAO_MailSettings',
197 'localizable' => 0,
198 'FKClassName' => 'CRM_Core_DAO_Domain',
199 'pseudoconstant' => [
200 'table' => 'civicrm_domain',
201 'keyColumn' => 'id',
202 'labelColumn' => 'name',
203 ],
204 'add' => '3.1',
205 ],
206 'name' => [
207 'name' => 'name',
208 'type' => CRM_Utils_Type::T_STRING,
209 'title' => ts('Mail Settings Name'),
210 'description' => ts('name of this group of settings'),
211 'maxlength' => 255,
212 'size' => CRM_Utils_Type::HUGE,
213 'where' => 'civicrm_mail_settings.name',
214 'table_name' => 'civicrm_mail_settings',
215 'entity' => 'MailSettings',
216 'bao' => 'CRM_Core_BAO_MailSettings',
217 'localizable' => 0,
218 'add' => '2.2',
219 ],
220 'is_default' => [
221 'name' => 'is_default',
222 'type' => CRM_Utils_Type::T_BOOLEAN,
223 'title' => ts('Is Default Mail Settings?'),
224 'description' => ts('whether this is the default set of settings for this domain'),
225 'where' => 'civicrm_mail_settings.is_default',
226 'table_name' => 'civicrm_mail_settings',
227 'entity' => 'MailSettings',
228 'bao' => 'CRM_Core_BAO_MailSettings',
229 'localizable' => 0,
230 'add' => '2.2',
231 ],
232 'domain' => [
233 'name' => 'domain',
234 'type' => CRM_Utils_Type::T_STRING,
235 'title' => ts('email Domain'),
236 'description' => ts('email address domain (the part after @)'),
237 'maxlength' => 255,
238 'size' => CRM_Utils_Type::HUGE,
239 'where' => 'civicrm_mail_settings.domain',
240 'table_name' => 'civicrm_mail_settings',
241 'entity' => 'MailSettings',
242 'bao' => 'CRM_Core_BAO_MailSettings',
243 'localizable' => 0,
244 'add' => '2.2',
245 ],
246 'localpart' => [
247 'name' => 'localpart',
248 'type' => CRM_Utils_Type::T_STRING,
249 'title' => ts('email Local Part'),
250 'description' => ts('optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)'),
251 'maxlength' => 255,
252 'size' => CRM_Utils_Type::HUGE,
253 'where' => 'civicrm_mail_settings.localpart',
254 'table_name' => 'civicrm_mail_settings',
255 'entity' => 'MailSettings',
256 'bao' => 'CRM_Core_BAO_MailSettings',
257 'localizable' => 0,
258 'add' => '2.2',
259 ],
260 'return_path' => [
261 'name' => 'return_path',
262 'type' => CRM_Utils_Type::T_STRING,
263 'title' => ts('Return Path'),
264 'description' => ts('contents of the Return-Path header'),
265 'maxlength' => 255,
266 'size' => CRM_Utils_Type::HUGE,
267 'where' => 'civicrm_mail_settings.return_path',
268 'table_name' => 'civicrm_mail_settings',
269 'entity' => 'MailSettings',
270 'bao' => 'CRM_Core_BAO_MailSettings',
271 'localizable' => 0,
272 'add' => '2.2',
273 ],
274 'protocol' => [
275 'name' => 'protocol',
276 'type' => CRM_Utils_Type::T_STRING,
277 'title' => ts('Protocol'),
278 'description' => ts('name of the protocol to use for polling (like IMAP, POP3 or Maildir)'),
279 'maxlength' => 255,
280 'size' => CRM_Utils_Type::HUGE,
281 'where' => 'civicrm_mail_settings.protocol',
282 'table_name' => 'civicrm_mail_settings',
283 'entity' => 'MailSettings',
284 'bao' => 'CRM_Core_BAO_MailSettings',
285 'localizable' => 0,
286 'html' => [
287 'type' => 'Select',
288 ],
289 'pseudoconstant' => [
290 'optionGroupName' => 'mail_protocol',
291 'optionEditPath' => 'civicrm/admin/options/mail_protocol',
292 ],
293 'add' => '2.2',
294 ],
295 'server' => [
296 'name' => 'server',
297 'type' => CRM_Utils_Type::T_STRING,
298 'title' => ts('Mail Server'),
299 'description' => ts('server to use when polling'),
300 'maxlength' => 255,
301 'size' => CRM_Utils_Type::HUGE,
302 'where' => 'civicrm_mail_settings.server',
303 'table_name' => 'civicrm_mail_settings',
304 'entity' => 'MailSettings',
305 'bao' => 'CRM_Core_BAO_MailSettings',
306 'localizable' => 0,
307 'add' => '2.2',
308 ],
309 'port' => [
310 'name' => 'port',
311 'type' => CRM_Utils_Type::T_INT,
312 'title' => ts('Mail Port'),
313 'description' => ts('port to use when polling'),
314 'where' => 'civicrm_mail_settings.port',
315 'table_name' => 'civicrm_mail_settings',
316 'entity' => 'MailSettings',
317 'bao' => 'CRM_Core_BAO_MailSettings',
318 'localizable' => 0,
319 'add' => '2.2',
320 ],
321 'username' => [
322 'name' => 'username',
323 'type' => CRM_Utils_Type::T_STRING,
324 'title' => ts('Mail Account Username'),
325 'description' => ts('username to use when polling'),
326 'maxlength' => 255,
327 'size' => CRM_Utils_Type::HUGE,
328 'where' => 'civicrm_mail_settings.username',
329 'table_name' => 'civicrm_mail_settings',
330 'entity' => 'MailSettings',
331 'bao' => 'CRM_Core_BAO_MailSettings',
332 'localizable' => 0,
333 'add' => '2.2',
334 ],
335 'password' => [
336 'name' => 'password',
337 'type' => CRM_Utils_Type::T_STRING,
338 'title' => ts('Mail Account Password'),
339 'description' => ts('password to use when polling'),
340 'maxlength' => 255,
341 'size' => CRM_Utils_Type::HUGE,
342 'where' => 'civicrm_mail_settings.password',
343 'table_name' => 'civicrm_mail_settings',
344 'entity' => 'MailSettings',
345 'bao' => 'CRM_Core_BAO_MailSettings',
346 'localizable' => 0,
347 'add' => '2.2',
348 ],
349 'is_ssl' => [
350 'name' => 'is_ssl',
351 'type' => CRM_Utils_Type::T_BOOLEAN,
352 'title' => ts('Mail Account Uses SSL'),
353 'description' => ts('whether to use SSL or not'),
354 'where' => 'civicrm_mail_settings.is_ssl',
355 'table_name' => 'civicrm_mail_settings',
356 'entity' => 'MailSettings',
357 'bao' => 'CRM_Core_BAO_MailSettings',
358 'localizable' => 0,
359 'add' => '2.2',
360 ],
361 'source' => [
362 'name' => 'source',
363 'type' => CRM_Utils_Type::T_STRING,
364 'title' => ts('Mail Folder'),
365 'description' => ts('folder to poll from when using IMAP, path to poll from when using Maildir, etc.'),
366 'maxlength' => 255,
367 'size' => CRM_Utils_Type::HUGE,
368 'where' => 'civicrm_mail_settings.source',
369 'table_name' => 'civicrm_mail_settings',
370 'entity' => 'MailSettings',
371 'bao' => 'CRM_Core_BAO_MailSettings',
372 'localizable' => 0,
373 'add' => '2.2',
374 ],
375 'activity_status' => [
376 'name' => 'activity_status',
377 'type' => CRM_Utils_Type::T_STRING,
378 'title' => ts('Activity Status'),
379 'description' => ts('Name of status to use when creating email to activity.'),
380 'maxlength' => 255,
381 'size' => CRM_Utils_Type::HUGE,
382 'where' => 'civicrm_mail_settings.activity_status',
383 'table_name' => 'civicrm_mail_settings',
384 'entity' => 'MailSettings',
385 'bao' => 'CRM_Core_BAO_MailSettings',
386 'localizable' => 0,
387 'html' => [
388 'type' => 'Select',
389 ],
390 'pseudoconstant' => [
391 'optionGroupName' => 'activity_status',
392 'keyColumn' => 'name',
393 'optionEditPath' => 'civicrm/admin/options/activity_status',
394 ],
395 'add' => '4.7',
396 ],
397 ];
398 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
399 }
400 return Civi::$statics[__CLASS__]['fields'];
401 }
402
403 /**
404 * Return a mapping from field-name to the corresponding key (as used in fields()).
405 *
406 * @return array
407 * Array(string $name => string $uniqueName).
408 */
409 public static function &fieldKeys() {
410 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
411 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
412 }
413 return Civi::$statics[__CLASS__]['fieldKeys'];
414 }
415
416 /**
417 * Returns the names of this table
418 *
419 * @return string
420 */
421 public static function getTableName() {
422 return self::$_tableName;
423 }
424
425 /**
426 * Returns if this table needs to be logged
427 *
428 * @return bool
429 */
430 public function getLog() {
431 return self::$_log;
432 }
433
434 /**
435 * Returns the list of fields that can be imported
436 *
437 * @param bool $prefix
438 *
439 * @return array
440 */
441 public static function &import($prefix = FALSE) {
442 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mail_settings', $prefix, []);
443 return $r;
444 }
445
446 /**
447 * Returns the list of fields that can be exported
448 *
449 * @param bool $prefix
450 *
451 * @return array
452 */
453 public static function &export($prefix = FALSE) {
454 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mail_settings', $prefix, []);
455 return $r;
456 }
457
458 /**
459 * Returns the list of indices
460 *
461 * @param bool $localize
462 *
463 * @return array
464 */
465 public static function indices($localize = TRUE) {
466 $indices = [];
467 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
468 }
469
470 }