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