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 | |
d31fb4e3 | 9 | * (GenCodeChecksum:c04dd12381de74d127ab1d4263fd5065) |
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 AH |
81 | public static function getEntityTitle($plural = FALSE) { |
82 | return $plural ? ts('Bounces') : ts('Bounce'); | |
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, |
a9d0587b | 118 | 'add' => NULL, |
c3fc2621 CW |
119 | ], |
120 | 'event_queue_id' => [ | |
e501603b TO |
121 | 'name' => 'event_queue_id', |
122 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 123 | 'title' => ts('Event Queue'), |
215b423e | 124 | 'description' => ts('FK to EventQueue'), |
c3fc2621 | 125 | 'required' => TRUE, |
a36434b9 | 126 | 'where' => 'civicrm_mailing_event_bounce.event_queue_id', |
522a26c9 | 127 | 'table_name' => 'civicrm_mailing_event_bounce', |
128 | 'entity' => 'Bounce', | |
129 | 'bao' => 'CRM_Mailing_Event_BAO_Bounce', | |
6a7e5e5d | 130 | 'localizable' => 0, |
e501603b | 131 | 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue', |
a9d0587b | 132 | 'add' => NULL, |
c3fc2621 CW |
133 | ], |
134 | 'bounce_type_id' => [ | |
e501603b TO |
135 | 'name' => 'bounce_type_id', |
136 | 'type' => CRM_Utils_Type::T_INT, | |
c3fc2621 | 137 | 'title' => ts('Bounce Type'), |
215b423e | 138 | 'description' => ts('What type of bounce was it?'), |
a36434b9 | 139 | 'where' => 'civicrm_mailing_event_bounce.bounce_type_id', |
522a26c9 | 140 | 'table_name' => 'civicrm_mailing_event_bounce', |
141 | 'entity' => 'Bounce', | |
142 | 'bao' => 'CRM_Mailing_Event_BAO_Bounce', | |
6a7e5e5d | 143 | 'localizable' => 0, |
c3fc2621 | 144 | 'html' => [ |
e501603b | 145 | 'type' => 'Select', |
c3fc2621 CW |
146 | ], |
147 | 'pseudoconstant' => [ | |
e501603b TO |
148 | 'table' => 'civicrm_mailing_bounce_type', |
149 | 'keyColumn' => 'id', | |
150 | 'labelColumn' => 'name', | |
e6ca0a57 | 151 | ], |
a9d0587b | 152 | 'add' => NULL, |
c3fc2621 CW |
153 | ], |
154 | 'bounce_reason' => [ | |
e501603b TO |
155 | 'name' => 'bounce_reason', |
156 | 'type' => CRM_Utils_Type::T_STRING, | |
c3fc2621 | 157 | 'title' => ts('Bounce Reason'), |
215b423e | 158 | 'description' => ts('The reason the email bounced.'), |
e501603b TO |
159 | 'maxlength' => 255, |
160 | 'size' => CRM_Utils_Type::HUGE, | |
a36434b9 | 161 | 'where' => 'civicrm_mailing_event_bounce.bounce_reason', |
522a26c9 | 162 | 'table_name' => 'civicrm_mailing_event_bounce', |
163 | 'entity' => 'Bounce', | |
164 | 'bao' => 'CRM_Mailing_Event_BAO_Bounce', | |
6a7e5e5d | 165 | 'localizable' => 0, |
a9d0587b | 166 | 'add' => NULL, |
c3fc2621 CW |
167 | ], |
168 | 'time_stamp' => [ | |
e501603b | 169 | 'name' => 'time_stamp', |
6c2b97b7 | 170 | 'type' => CRM_Utils_Type::T_TIMESTAMP, |
c3fc2621 | 171 | 'title' => ts('Timestamp'), |
215b423e | 172 | 'description' => ts('When this bounce event occurred.'), |
c3fc2621 | 173 | 'required' => TRUE, |
a36434b9 | 174 | 'where' => 'civicrm_mailing_event_bounce.time_stamp', |
6c2b97b7 | 175 | 'default' => 'CURRENT_TIMESTAMP', |
522a26c9 | 176 | 'table_name' => 'civicrm_mailing_event_bounce', |
177 | 'entity' => 'Bounce', | |
178 | 'bao' => 'CRM_Mailing_Event_BAO_Bounce', | |
6a7e5e5d | 179 | 'localizable' => 0, |
a9d0587b | 180 | 'add' => NULL, |
c3fc2621 CW |
181 | ], |
182 | ]; | |
346aaaba | 183 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 184 | } |
346aaaba | 185 | return Civi::$statics[__CLASS__]['fields']; |
e501603b | 186 | } |
c3fc2621 | 187 | |
e501603b | 188 | /** |
bd8e0b14 | 189 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
190 | * |
191 | * @return array | |
bd8e0b14 | 192 | * Array(string $name => string $uniqueName). |
e501603b | 193 | */ |
c3fc2621 | 194 | public static function &fieldKeys() { |
bd8e0b14 TO |
195 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
196 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 197 | } |
bd8e0b14 | 198 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b | 199 | } |
c3fc2621 | 200 | |
e501603b TO |
201 | /** |
202 | * Returns the names of this table | |
203 | * | |
204 | * @return string | |
205 | */ | |
c3fc2621 | 206 | public static function getTableName() { |
e501603b TO |
207 | return self::$_tableName; |
208 | } | |
c3fc2621 | 209 | |
e501603b TO |
210 | /** |
211 | * Returns if this table needs to be logged | |
212 | * | |
c3fc2621 | 213 | * @return bool |
e501603b | 214 | */ |
c3fc2621 | 215 | public function getLog() { |
e501603b TO |
216 | return self::$_log; |
217 | } | |
c3fc2621 | 218 | |
e501603b TO |
219 | /** |
220 | * Returns the list of fields that can be imported | |
221 | * | |
222 | * @param bool $prefix | |
223 | * | |
224 | * @return array | |
225 | */ | |
c3fc2621 CW |
226 | public static function &import($prefix = FALSE) { |
227 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_bounce', $prefix, []); | |
60808919 | 228 | return $r; |
e501603b | 229 | } |
c3fc2621 | 230 | |
e501603b TO |
231 | /** |
232 | * Returns the list of fields that can be exported | |
233 | * | |
234 | * @param bool $prefix | |
235 | * | |
236 | * @return array | |
237 | */ | |
c3fc2621 CW |
238 | public static function &export($prefix = FALSE) { |
239 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_bounce', $prefix, []); | |
60808919 | 240 | return $r; |
e501603b | 241 | } |
c3fc2621 | 242 | |
e7a6b91a AS |
243 | /** |
244 | * Returns the list of indices | |
c3fc2621 CW |
245 | * |
246 | * @param bool $localize | |
247 | * | |
248 | * @return array | |
e7a6b91a AS |
249 | */ |
250 | public static function indices($localize = TRUE) { | |
c3fc2621 | 251 | $indices = []; |
e7a6b91a AS |
252 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; |
253 | } | |
c3fc2621 | 254 | |
e501603b | 255 | } |