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