Commit | Line | Data |
---|---|---|
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/Mailing/Event/Bounce.xml | |
8 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
2562d09a | 9 | * (GenCodeChecksum:6f3c41c50e9baa89d14295479d66975c) |
e501603b | 10 | */ |
c3fc2621 | 11 | |
f41f0342 | 12 | /** |
c3fc2621 | 13 | * Database access object for the Bounce entity. |
f41f0342 | 14 | */ |
e501603b | 15 | class CRM_Mailing_Event_DAO_Bounce extends CRM_Core_DAO { |
929a1c14 CW |
16 | const EXT = 'civicrm'; |
17 | const TABLE_ADDED = ''; | |
d31fb4e3 | 18 | const COMPONENT = 'CiviMail'; |
c3fc2621 | 19 | |
e501603b | 20 | /** |
f41f0342 | 21 | * Static instance to hold the table name. |
e501603b TO |
22 | * |
23 | * @var string | |
24 | */ | |
fa45b5b9 | 25 | public static $_tableName = 'civicrm_mailing_event_bounce'; |
c3fc2621 | 26 | |
e501603b | 27 | /** |
f41f0342 | 28 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b | 29 | * |
c3fc2621 | 30 | * @var bool |
e501603b | 31 | */ |
fa45b5b9 | 32 | public static $_log = FALSE; |
c3fc2621 | 33 | |
e501603b | 34 | /** |
e6ca0a57 | 35 | * @var int |
e501603b TO |
36 | */ |
37 | public $id; | |
c3fc2621 | 38 | |
e501603b TO |
39 | /** |
40 | * FK to EventQueue | |
41 | * | |
e6ca0a57 | 42 | * @var int |
e501603b TO |
43 | */ |
44 | public $event_queue_id; | |
c3fc2621 | 45 | |
e501603b TO |
46 | /** |
47 | * What type of bounce was it? | |
48 | * | |
e6ca0a57 | 49 | * @var int |
e501603b TO |
50 | */ |
51 | public $bounce_type_id; | |
c3fc2621 | 52 | |
e501603b TO |
53 | /** |
54 | * The reason the email bounced. | |
55 | * | |
56 | * @var string | |
57 | */ | |
58 | public $bounce_reason; | |
c3fc2621 | 59 | |
e501603b TO |
60 | /** |
61 | * When this bounce event occurred. | |
62 | * | |
6c2b97b7 | 63 | * @var timestamp |
e501603b TO |
64 | */ |
65 | public $time_stamp; | |
c3fc2621 | 66 | |
e501603b | 67 | /** |
f41f0342 | 68 | * Class constructor. |
e501603b | 69 | */ |
c3fc2621 | 70 | public function __construct() { |
e501603b TO |
71 | $this->__table = 'civicrm_mailing_event_bounce'; |
72 | parent::__construct(); | |
73 | } | |
c3fc2621 | 74 | |
449c4e6b CW |
75 | /** |
76 | * Returns localized title of this entity. | |
7b66c3b5 AH |
77 | * |
78 | * @param bool $plural | |
79 | * Whether to return the plural version of the title. | |
449c4e6b | 80 | */ |
7b66c3b5 | 81 | public static function getEntityTitle($plural = FALSE) { |
95820237 | 82 | return $plural ? ts('Mailing Bounce Events') : ts('Mailing Bounce Event'); |
449c4e6b CW |
83 | } |
84 | ||
e501603b | 85 | /** |
f41f0342 | 86 | * Returns foreign keys and entity references. |
e501603b TO |
87 | * |
88 | * @return array | |
89 | * [CRM_Core_Reference_Interface] | |
90 | */ | |
c3fc2621 | 91 | public static function getReferenceColumns() { |
346aaaba | 92 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
a36434b9 | 93 | Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__); |
c3fc2621 | 94 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); |
346aaaba | 95 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); |
e501603b | 96 | } |
346aaaba | 97 | return Civi::$statics[__CLASS__]['links']; |
e501603b | 98 | } |
c3fc2621 | 99 | |
e501603b TO |
100 | /** |
101 | * Returns all the column names of this table | |
102 | * | |
103 | * @return array | |
104 | */ | |
c3fc2621 | 105 | public static function &fields() { |
346aaaba | 106 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
c3fc2621 CW |
107 | Civi::$statics[__CLASS__]['fields'] = [ |
108 | 'id' => [ | |
e501603b TO |
109 | 'name' => 'id', |
110 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 CW |
111 | 'title' => ts('Bounce ID'), |
112 | 'required' => TRUE, | |
a36434b9 | 113 | 'where' => 'civicrm_mailing_event_bounce.id', |
522a26c9 | 114 | 'table_name' => 'civicrm_mailing_event_bounce', |
115 | 'entity' => 'Bounce', | |
116 | 'bao' => 'CRM_Mailing_Event_BAO_Bounce', | |
6a7e5e5d | 117 | 'localizable' => 0, |
2cbbebe8 A |
118 | 'html' => [ |
119 | 'type' => 'Number', | |
120 | ], | |
1fe423d6 | 121 | 'readonly' => TRUE, |
a9d0587b | 122 | 'add' => NULL, |
c3fc2621 CW |
123 | ], |
124 | 'event_queue_id' => [ | |
e501603b TO |
125 | 'name' => 'event_queue_id', |
126 | 'type' => CRM_Utils_Type::T_INT, | |
2cbbebe8 | 127 | 'title' => ts('Event Queue ID'), |
215b423e | 128 | 'description' => ts('FK to EventQueue'), |
c3fc2621 | 129 | 'required' => TRUE, |
a36434b9 | 130 | 'where' => 'civicrm_mailing_event_bounce.event_queue_id', |
522a26c9 | 131 | 'table_name' => 'civicrm_mailing_event_bounce', |
132 | 'entity' => 'Bounce', | |
133 | 'bao' => 'CRM_Mailing_Event_BAO_Bounce', | |
6a7e5e5d | 134 | 'localizable' => 0, |
e501603b | 135 | 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue', |
2cbbebe8 A |
136 | 'html' => [ |
137 | 'label' => ts("Event Queue"), | |
138 | ], | |
a9d0587b | 139 | 'add' => NULL, |
c3fc2621 CW |
140 | ], |
141 | 'bounce_type_id' => [ | |
e501603b TO |
142 | 'name' => 'bounce_type_id', |
143 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 144 | 'title' => ts('Bounce Type'), |
215b423e | 145 | 'description' => ts('What type of bounce was it?'), |
a36434b9 | 146 | 'where' => 'civicrm_mailing_event_bounce.bounce_type_id', |
522a26c9 | 147 | 'table_name' => 'civicrm_mailing_event_bounce', |
148 | 'entity' => 'Bounce', | |
149 | 'bao' => 'CRM_Mailing_Event_BAO_Bounce', | |
6a7e5e5d | 150 | 'localizable' => 0, |
c3fc2621 | 151 | 'html' => [ |
e501603b | 152 | 'type' => 'Select', |
c3fc2621 CW |
153 | ], |
154 | 'pseudoconstant' => [ | |
e501603b TO |
155 | 'table' => 'civicrm_mailing_bounce_type', |
156 | 'keyColumn' => 'id', | |
157 | 'labelColumn' => 'name', | |
e6ca0a57 | 158 | ], |
a9d0587b | 159 | 'add' => NULL, |
c3fc2621 CW |
160 | ], |
161 | 'bounce_reason' => [ | |
e501603b TO |
162 | 'name' => 'bounce_reason', |
163 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 164 | 'title' => ts('Bounce Reason'), |
215b423e | 165 | 'description' => ts('The reason the email bounced.'), |
e501603b TO |
166 | 'maxlength' => 255, |
167 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 168 | 'where' => 'civicrm_mailing_event_bounce.bounce_reason', |
522a26c9 | 169 | 'table_name' => 'civicrm_mailing_event_bounce', |
170 | 'entity' => 'Bounce', | |
171 | 'bao' => 'CRM_Mailing_Event_BAO_Bounce', | |
6a7e5e5d | 172 | 'localizable' => 0, |
a9d0587b | 173 | 'add' => NULL, |
c3fc2621 CW |
174 | ], |
175 | 'time_stamp' => [ | |
e501603b | 176 | 'name' => 'time_stamp', |
6c2b97b7 | 177 | 'type' => CRM_Utils_Type::T_TIMESTAMP, |
c3fc2621 | 178 | 'title' => ts('Timestamp'), |
215b423e | 179 | 'description' => ts('When this bounce event occurred.'), |
c3fc2621 | 180 | 'required' => TRUE, |
a36434b9 | 181 | 'where' => 'civicrm_mailing_event_bounce.time_stamp', |
6c2b97b7 | 182 | 'default' => 'CURRENT_TIMESTAMP', |
522a26c9 | 183 | 'table_name' => 'civicrm_mailing_event_bounce', |
184 | 'entity' => 'Bounce', | |
185 | 'bao' => 'CRM_Mailing_Event_BAO_Bounce', | |
6a7e5e5d | 186 | 'localizable' => 0, |
a9d0587b | 187 | 'add' => NULL, |
c3fc2621 CW |
188 | ], |
189 | ]; | |
346aaaba | 190 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 191 | } |
346aaaba | 192 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 193 | } |
c3fc2621 | 194 | |
e501603b | 195 | /** |
bd8e0b14 | 196 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
197 | * |
198 | * @return array | |
bd8e0b14 | 199 | * Array(string $name => string $uniqueName). |
e501603b | 200 | */ |
c3fc2621 | 201 | public static function &fieldKeys() { |
bd8e0b14 TO |
202 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
203 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 204 | } |
bd8e0b14 | 205 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 206 | } |
c3fc2621 | 207 | |
e501603b TO |
208 | /** |
209 | * Returns the names of this table | |
210 | * | |
211 | * @return string | |
212 | */ | |
c3fc2621 | 213 | public static function getTableName() { |
e501603b TO |
214 | return self::$_tableName; |
215 | } | |
c3fc2621 | 216 | |
e501603b TO |
217 | /** |
218 | * Returns if this table needs to be logged | |
219 | * | |
c3fc2621 | 220 | * @return bool |
e501603b | 221 | */ |
c3fc2621 | 222 | public function getLog() { |
e501603b TO |
223 | return self::$_log; |
224 | } | |
c3fc2621 | 225 | |
e501603b TO |
226 | /** |
227 | * Returns the list of fields that can be imported | |
228 | * | |
229 | * @param bool $prefix | |
230 | * | |
231 | * @return array | |
232 | */ | |
c3fc2621 CW |
233 | public static function &import($prefix = FALSE) { |
234 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_bounce', $prefix, []); | |
60808919 | 235 | return $r; |
e501603b | 236 | } |
c3fc2621 | 237 | |
e501603b TO |
238 | /** |
239 | * Returns the list of fields that can be exported | |
240 | * | |
241 | * @param bool $prefix | |
242 | * | |
243 | * @return array | |
244 | */ | |
c3fc2621 CW |
245 | public static function &export($prefix = FALSE) { |
246 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_bounce', $prefix, []); | |
60808919 | 247 | return $r; |
e501603b | 248 | } |
c3fc2621 | 249 | |
e7a6b91a AS |
250 | /** |
251 | * Returns the list of indices | |
c3fc2621 CW |
252 | * |
253 | * @param bool $localize | |
254 | * | |
255 | * @return array | |
e7a6b91a AS |
256 | */ |
257 | public static function indices($localize = TRUE) { | |
c3fc2621 | 258 | $indices = []; |
e7a6b91a AS |
259 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
260 | } | |
c3fc2621 | 261 | |
e501603b | 262 | } |