Merge pull request #11142 from JMAConsulting/CRM-21260
[civicrm-core.git] / CRM / Mailing / DAO / BounceType.php
... / ...
CommitLineData
1<?php
2
3/**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2017
6 *
7 * Generated from xml/schema/CRM/Mailing/BounceType.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:58e082dadf7a5125e5c34d0f9cffb0f1)
10 */
11
12/**
13 * Database access object for the BounceType entity.
14 */
15class CRM_Mailing_DAO_BounceType extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_mailing_bounce_type';
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 * @var int unsigned
33 */
34 public $id;
35
36 /**
37 * Type of bounce
38 *
39 * @var string
40 */
41 public $name;
42
43 /**
44 * A description of this bounce type
45 *
46 * @var string
47 */
48 public $description;
49
50 /**
51 * Number of bounces of this type required before the email address is put on bounce hold
52 *
53 * @var int unsigned
54 */
55 public $hold_threshold;
56
57 /**
58 * Class constructor.
59 */
60 public function __construct() {
61 $this->__table = 'civicrm_mailing_bounce_type';
62 parent::__construct();
63 }
64
65 /**
66 * Returns all the column names of this table
67 *
68 * @return array
69 */
70 public static function &fields() {
71 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
72 Civi::$statics[__CLASS__]['fields'] = [
73 'id' => [
74 'name' => 'id',
75 'type' => CRM_Utils_Type::T_INT,
76 'title' => ts('Bounce Type ID'),
77 'required' => TRUE,
78 'table_name' => 'civicrm_mailing_bounce_type',
79 'entity' => 'BounceType',
80 'bao' => 'CRM_Mailing_DAO_BounceType',
81 'localizable' => 0,
82 ],
83 'name' => [
84 'name' => 'name',
85 'type' => CRM_Utils_Type::T_STRING,
86 'title' => ts('Bounce Type Name'),
87 'description' => 'Type of bounce',
88 'required' => TRUE,
89 'maxlength' => 24,
90 'size' => CRM_Utils_Type::MEDIUM,
91 'table_name' => 'civicrm_mailing_bounce_type',
92 'entity' => 'BounceType',
93 'bao' => 'CRM_Mailing_DAO_BounceType',
94 'localizable' => 0,
95 ],
96 'description' => [
97 'name' => 'description',
98 'type' => CRM_Utils_Type::T_STRING,
99 'title' => ts('Bounce Type Description'),
100 'description' => 'A description of this bounce type',
101 'maxlength' => 255,
102 'size' => CRM_Utils_Type::HUGE,
103 'table_name' => 'civicrm_mailing_bounce_type',
104 'entity' => 'BounceType',
105 'bao' => 'CRM_Mailing_DAO_BounceType',
106 'localizable' => 0,
107 ],
108 'hold_threshold' => [
109 'name' => 'hold_threshold',
110 'type' => CRM_Utils_Type::T_INT,
111 'title' => ts('Hold Threshold'),
112 'description' => 'Number of bounces of this type required before the email address is put on bounce hold',
113 'required' => TRUE,
114 'table_name' => 'civicrm_mailing_bounce_type',
115 'entity' => 'BounceType',
116 'bao' => 'CRM_Mailing_DAO_BounceType',
117 'localizable' => 0,
118 ],
119 ];
120 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
121 }
122 return Civi::$statics[__CLASS__]['fields'];
123 }
124
125 /**
126 * Return a mapping from field-name to the corresponding key (as used in fields()).
127 *
128 * @return array
129 * Array(string $name => string $uniqueName).
130 */
131 public static function &fieldKeys() {
132 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
133 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
134 }
135 return Civi::$statics[__CLASS__]['fieldKeys'];
136 }
137
138 /**
139 * Returns the names of this table
140 *
141 * @return string
142 */
143 public static function getTableName() {
144 return self::$_tableName;
145 }
146
147 /**
148 * Returns if this table needs to be logged
149 *
150 * @return bool
151 */
152 public function getLog() {
153 return self::$_log;
154 }
155
156 /**
157 * Returns the list of fields that can be imported
158 *
159 * @param bool $prefix
160 *
161 * @return array
162 */
163 public static function &import($prefix = FALSE) {
164 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_bounce_type', $prefix, []);
165 return $r;
166 }
167
168 /**
169 * Returns the list of fields that can be exported
170 *
171 * @param bool $prefix
172 *
173 * @return array
174 */
175 public static function &export($prefix = FALSE) {
176 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_bounce_type', $prefix, []);
177 return $r;
178 }
179
180 /**
181 * Returns the list of indices
182 *
183 * @param bool $localize
184 *
185 * @return array
186 */
187 public static function indices($localize = TRUE) {
188 $indices = [];
189 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
190 }
191
192}