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