Reformat DAO files to pass linting and use short array syntax
[civicrm-core.git] / CRM / Core / DAO / MailSettings.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2017
6 *
7 * Generated from xml/schema/CRM/Core/MailSettings.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:86515d7cb55425fbad3a71d5aa000af0)
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 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 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' => 'primary key',
172 'required' => TRUE,
173 'table_name' => 'civicrm_mail_settings',
174 'entity' => 'MailSettings',
175 'bao' => 'CRM_Core_BAO_MailSettings',
176 'localizable' => 0,
177 ],
178 'domain_id' => [
179 'name' => 'domain_id',
180 'type' => CRM_Utils_Type::T_INT,
181 'title' => ts('Mail Settings Domain'),
182 'description' => 'Which Domain is this match entry for',
183 'required' => TRUE,
184 'table_name' => 'civicrm_mail_settings',
185 'entity' => 'MailSettings',
186 'bao' => 'CRM_Core_BAO_MailSettings',
187 'localizable' => 0,
188 'FKClassName' => 'CRM_Core_DAO_Domain',
189 'pseudoconstant' => [
190 'table' => 'civicrm_domain',
191 'keyColumn' => 'id',
192 'labelColumn' => 'name',
193 ]
194 ],
195 'name' => [
196 'name' => 'name',
197 'type' => CRM_Utils_Type::T_STRING,
198 'title' => ts('Mail Settings Name'),
199 'description' => 'name of this group of settings',
200 'maxlength' => 255,
201 'size' => CRM_Utils_Type::HUGE,
202 'table_name' => 'civicrm_mail_settings',
203 'entity' => 'MailSettings',
204 'bao' => 'CRM_Core_BAO_MailSettings',
205 'localizable' => 0,
206 ],
207 'is_default' => [
208 'name' => 'is_default',
209 'type' => CRM_Utils_Type::T_BOOLEAN,
210 'title' => ts('Is Default Mail Settings?'),
211 'description' => 'whether this is the default set of settings for this domain',
212 'table_name' => 'civicrm_mail_settings',
213 'entity' => 'MailSettings',
214 'bao' => 'CRM_Core_BAO_MailSettings',
215 'localizable' => 0,
216 ],
217 'domain' => [
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 'table_name' => 'civicrm_mail_settings',
225 'entity' => 'MailSettings',
226 'bao' => 'CRM_Core_BAO_MailSettings',
227 'localizable' => 0,
228 ],
229 'localpart' => [
230 'name' => 'localpart',
231 'type' => CRM_Utils_Type::T_STRING,
232 'title' => ts('email Local Part'),
233 'description' => 'optional local part (like civimail+ for addresses like civimail+s.1.2@example.com)',
234 'maxlength' => 255,
235 'size' => CRM_Utils_Type::HUGE,
236 'table_name' => 'civicrm_mail_settings',
237 'entity' => 'MailSettings',
238 'bao' => 'CRM_Core_BAO_MailSettings',
239 'localizable' => 0,
240 ],
241 'return_path' => [
242 'name' => 'return_path',
243 'type' => CRM_Utils_Type::T_STRING,
244 'title' => ts('Return Path'),
245 'description' => 'contents of the Return-Path header',
246 'maxlength' => 255,
247 'size' => CRM_Utils_Type::HUGE,
248 'table_name' => 'civicrm_mail_settings',
249 'entity' => 'MailSettings',
250 'bao' => 'CRM_Core_BAO_MailSettings',
251 'localizable' => 0,
252 ],
253 'protocol' => [
254 'name' => 'protocol',
255 'type' => CRM_Utils_Type::T_STRING,
256 'title' => ts('Protocol'),
257 'description' => 'name of the protocol to use for polling (like IMAP, POP3 or Maildir)',
258 'maxlength' => 255,
259 'size' => CRM_Utils_Type::HUGE,
260 'table_name' => 'civicrm_mail_settings',
261 'entity' => 'MailSettings',
262 'bao' => 'CRM_Core_BAO_MailSettings',
263 'localizable' => 0,
264 'html' => [
265 'type' => 'Select',
266 ],
267 'pseudoconstant' => [
268 'optionGroupName' => 'mail_protocol',
269 'optionEditPath' => 'civicrm/admin/options/mail_protocol',
270 ]
271 ],
272 'server' => [
273 'name' => 'server',
274 'type' => CRM_Utils_Type::T_STRING,
275 'title' => ts('Mail Server'),
276 'description' => 'server to use when polling',
277 'maxlength' => 255,
278 'size' => CRM_Utils_Type::HUGE,
279 'table_name' => 'civicrm_mail_settings',
280 'entity' => 'MailSettings',
281 'bao' => 'CRM_Core_BAO_MailSettings',
282 'localizable' => 0,
283 ],
284 'port' => [
285 'name' => 'port',
286 'type' => CRM_Utils_Type::T_INT,
287 'title' => ts('Mail Port'),
288 'description' => 'port to use when polling',
289 'table_name' => 'civicrm_mail_settings',
290 'entity' => 'MailSettings',
291 'bao' => 'CRM_Core_BAO_MailSettings',
292 'localizable' => 0,
293 ],
294 'username' => [
295 'name' => 'username',
296 'type' => CRM_Utils_Type::T_STRING,
297 'title' => ts('Mail Account Username'),
298 'description' => 'username to use when polling',
299 'maxlength' => 255,
300 'size' => CRM_Utils_Type::HUGE,
301 'table_name' => 'civicrm_mail_settings',
302 'entity' => 'MailSettings',
303 'bao' => 'CRM_Core_BAO_MailSettings',
304 'localizable' => 0,
305 ],
306 'password' => [
307 'name' => 'password',
308 'type' => CRM_Utils_Type::T_STRING,
309 'title' => ts('Mail Account Password'),
310 'description' => 'password to use when polling',
311 'maxlength' => 255,
312 'size' => CRM_Utils_Type::HUGE,
313 'table_name' => 'civicrm_mail_settings',
314 'entity' => 'MailSettings',
315 'bao' => 'CRM_Core_BAO_MailSettings',
316 'localizable' => 0,
317 ],
318 'is_ssl' => [
319 'name' => 'is_ssl',
320 'type' => CRM_Utils_Type::T_BOOLEAN,
321 'title' => ts('Mail Account Uses SSL'),
322 'description' => 'whether to use SSL or not',
323 'table_name' => 'civicrm_mail_settings',
324 'entity' => 'MailSettings',
325 'bao' => 'CRM_Core_BAO_MailSettings',
326 'localizable' => 0,
327 ],
328 'source' => [
329 'name' => 'source',
330 'type' => CRM_Utils_Type::T_STRING,
331 'title' => ts('Mail Folder'),
332 'description' => 'folder to poll from when using IMAP, path to poll from when using Maildir, etc.',
333 'maxlength' => 255,
334 'size' => CRM_Utils_Type::HUGE,
335 'table_name' => 'civicrm_mail_settings',
336 'entity' => 'MailSettings',
337 'bao' => 'CRM_Core_BAO_MailSettings',
338 'localizable' => 0,
339 ],
340 'activity_status' => [
341 'name' => 'activity_status',
342 'type' => CRM_Utils_Type::T_STRING,
343 'title' => ts('Activity Status'),
344 'description' => 'Name of status to use when creating email to activity.',
345 'maxlength' => 255,
346 'size' => CRM_Utils_Type::HUGE,
347 'table_name' => 'civicrm_mail_settings',
348 'entity' => 'MailSettings',
349 'bao' => 'CRM_Core_BAO_MailSettings',
350 'localizable' => 0,
351 'html' => [
352 'type' => 'Select',
353 ],
354 'pseudoconstant' => [
355 'optionGroupName' => 'activity_status',
356 'keyColumn' => 'name',
357 'optionEditPath' => 'civicrm/admin/options/activity_status',
358 ]
359 ],
360 ];
361 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
362 }
363 return Civi::$statics[__CLASS__]['fields'];
364 }
365
366 /**
367 * Return a mapping from field-name to the corresponding key (as used in fields()).
368 *
369 * @return array
370 * Array(string $name => string $uniqueName).
371 */
372 public static function &fieldKeys() {
373 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
374 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
375 }
376 return Civi::$statics[__CLASS__]['fieldKeys'];
377 }
378
379 /**
380 * Returns the names of this table
381 *
382 * @return string
383 */
384 public static function getTableName() {
385 return self::$_tableName;
386 }
387
388 /**
389 * Returns if this table needs to be logged
390 *
391 * @return bool
392 */
393 public function getLog() {
394 return self::$_log;
395 }
396
397 /**
398 * Returns the list of fields that can be imported
399 *
400 * @param bool $prefix
401 *
402 * @return array
403 */
404 public static function &import($prefix = FALSE) {
405 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mail_settings', $prefix, []);
406 return $r;
407 }
408
409 /**
410 * Returns the list of fields that can be exported
411 *
412 * @param bool $prefix
413 *
414 * @return array
415 */
416 public static function &export($prefix = FALSE) {
417 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mail_settings', $prefix, []);
418 return $r;
419 }
420
421 /**
422 * Returns the list of indices
423 *
424 * @param bool $localize
425 *
426 * @return array
427 */
428 public static function indices($localize = TRUE) {
429 $indices = [];
430 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
431 }
432
433 }