(NFC) Regenerate DAO Checksums after changes to codegen
[civicrm-core.git] / CRM / Mailing / Event / DAO / Bounce.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC (c) 2004-2018
6 *
7 * Generated from xml/schema/CRM/Mailing/Event/Bounce.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:5243c65d5b727e60e1fdedb9fa3e84e2)
10 */
11
12 /**
13 * Database access object for the Bounce entity.
14 */
15 class CRM_Mailing_Event_DAO_Bounce extends CRM_Core_DAO {
16
17 /**
18 * Static instance to hold the table name.
19 *
20 * @var string
21 */
22 static $_tableName = 'civicrm_mailing_event_bounce';
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 * FK to EventQueue
38 *
39 * @var int unsigned
40 */
41 public $event_queue_id;
42
43 /**
44 * What type of bounce was it?
45 *
46 * @var int unsigned
47 */
48 public $bounce_type_id;
49
50 /**
51 * The reason the email bounced.
52 *
53 * @var string
54 */
55 public $bounce_reason;
56
57 /**
58 * When this bounce event occurred.
59 *
60 * @var timestamp
61 */
62 public $time_stamp;
63
64 /**
65 * Class constructor.
66 */
67 public function __construct() {
68 $this->__table = 'civicrm_mailing_event_bounce';
69 parent::__construct();
70 }
71
72 /**
73 * Returns foreign keys and entity references.
74 *
75 * @return array
76 * [CRM_Core_Reference_Interface]
77 */
78 public static function getReferenceColumns() {
79 if (!isset(Civi::$statics[__CLASS__]['links'])) {
80 Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__);
81 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id');
82 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
83 }
84 return Civi::$statics[__CLASS__]['links'];
85 }
86
87 /**
88 * Returns all the column names of this table
89 *
90 * @return array
91 */
92 public static function &fields() {
93 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
94 Civi::$statics[__CLASS__]['fields'] = [
95 'id' => [
96 'name' => 'id',
97 'type' => CRM_Utils_Type::T_INT,
98 'title' => ts('Bounce ID'),
99 'required' => TRUE,
100 'table_name' => 'civicrm_mailing_event_bounce',
101 'entity' => 'Bounce',
102 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
103 'localizable' => 0,
104 ],
105 'event_queue_id' => [
106 'name' => 'event_queue_id',
107 'type' => CRM_Utils_Type::T_INT,
108 'title' => ts('Event Queue'),
109 'description' => ts('FK to EventQueue'),
110 'required' => TRUE,
111 'table_name' => 'civicrm_mailing_event_bounce',
112 'entity' => 'Bounce',
113 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
114 'localizable' => 0,
115 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
116 ],
117 'bounce_type_id' => [
118 'name' => 'bounce_type_id',
119 'type' => CRM_Utils_Type::T_INT,
120 'title' => ts('Bounce Type'),
121 'description' => ts('What type of bounce was it?'),
122 'table_name' => 'civicrm_mailing_event_bounce',
123 'entity' => 'Bounce',
124 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
125 'localizable' => 0,
126 'html' => [
127 'type' => 'Select',
128 ],
129 'pseudoconstant' => [
130 'table' => 'civicrm_mailing_bounce_type',
131 'keyColumn' => 'id',
132 'labelColumn' => 'name',
133 ]
134 ],
135 'bounce_reason' => [
136 'name' => 'bounce_reason',
137 'type' => CRM_Utils_Type::T_STRING,
138 'title' => ts('Bounce Reason'),
139 'description' => ts('The reason the email bounced.'),
140 'maxlength' => 255,
141 'size' => CRM_Utils_Type::HUGE,
142 'table_name' => 'civicrm_mailing_event_bounce',
143 'entity' => 'Bounce',
144 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
145 'localizable' => 0,
146 ],
147 'time_stamp' => [
148 'name' => 'time_stamp',
149 'type' => CRM_Utils_Type::T_TIMESTAMP,
150 'title' => ts('Timestamp'),
151 'description' => ts('When this bounce event occurred.'),
152 'required' => TRUE,
153 'default' => 'CURRENT_TIMESTAMP',
154 'table_name' => 'civicrm_mailing_event_bounce',
155 'entity' => 'Bounce',
156 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
157 'localizable' => 0,
158 ],
159 ];
160 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
161 }
162 return Civi::$statics[__CLASS__]['fields'];
163 }
164
165 /**
166 * Return a mapping from field-name to the corresponding key (as used in fields()).
167 *
168 * @return array
169 * Array(string $name => string $uniqueName).
170 */
171 public static function &fieldKeys() {
172 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
173 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
174 }
175 return Civi::$statics[__CLASS__]['fieldKeys'];
176 }
177
178 /**
179 * Returns the names of this table
180 *
181 * @return string
182 */
183 public static function getTableName() {
184 return self::$_tableName;
185 }
186
187 /**
188 * Returns if this table needs to be logged
189 *
190 * @return bool
191 */
192 public function getLog() {
193 return self::$_log;
194 }
195
196 /**
197 * Returns the list of fields that can be imported
198 *
199 * @param bool $prefix
200 *
201 * @return array
202 */
203 public static function &import($prefix = FALSE) {
204 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_bounce', $prefix, []);
205 return $r;
206 }
207
208 /**
209 * Returns the list of fields that can be exported
210 *
211 * @param bool $prefix
212 *
213 * @return array
214 */
215 public static function &export($prefix = FALSE) {
216 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_bounce', $prefix, []);
217 return $r;
218 }
219
220 /**
221 * Returns the list of indices
222 *
223 * @param bool $localize
224 *
225 * @return array
226 */
227 public static function indices($localize = TRUE) {
228 $indices = [];
229 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
230 }
231
232 }