Commit | Line | Data |
---|---|---|
e501603b TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
4 | | CiviCRM version 4.7 | | |
5 | +--------------------------------------------------------------------+ | |
0f03f337 | 6 | | Copyright CiviCRM LLC (c) 2004-2017 | |
e501603b TO |
7 | +--------------------------------------------------------------------+ |
8 | | This file is a part of CiviCRM. | | |
9 | | | | |
10 | | CiviCRM is free software; you can copy, modify, and distribute it | | |
11 | | under the terms of the GNU Affero General Public License | | |
12 | | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. | | |
13 | | | | |
14 | | CiviCRM is distributed in the hope that it will be useful, but | | |
15 | | WITHOUT ANY WARRANTY; without even the implied warranty of | | |
16 | | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | | |
17 | | See the GNU Affero General Public License for more details. | | |
18 | | | | |
19 | | You should have received a copy of the GNU Affero General Public | | |
20 | | License and the CiviCRM Licensing Exception along | | |
21 | | with this program; if not, contact CiviCRM LLC | | |
22 | | at info[AT]civicrm[DOT]org. If you have questions about the | | |
23 | | GNU Affero General Public License or the licensing of CiviCRM, | | |
24 | | see the CiviCRM license FAQ at http://civicrm.org/licensing | | |
25 | +--------------------------------------------------------------------+ | |
26 | */ | |
27 | /** | |
28 | * @package CRM | |
0f03f337 | 29 | * @copyright CiviCRM LLC (c) 2004-2017 |
e501603b TO |
30 | * |
31 | * Generated from xml/schema/CRM/Mailing/Event/Bounce.xml | |
32 | * DO NOT EDIT. Generated by CRM_Core_CodeGen | |
022785d8 | 33 | * (GenCodeChecksum:b3ece7fb5a8c702f3a9c8e4bef1a38ca) |
e501603b TO |
34 | */ |
35 | require_once 'CRM/Core/DAO.php'; | |
36 | require_once 'CRM/Utils/Type.php'; | |
f41f0342 | 37 | /** |
38 | * CRM_Mailing_Event_DAO_Bounce constructor. | |
39 | */ | |
e501603b TO |
40 | class CRM_Mailing_Event_DAO_Bounce extends CRM_Core_DAO { |
41 | /** | |
f41f0342 | 42 | * Static instance to hold the table name. |
e501603b TO |
43 | * |
44 | * @var string | |
45 | */ | |
46 | static $_tableName = 'civicrm_mailing_event_bounce'; | |
e501603b | 47 | /** |
f41f0342 | 48 | * Should CiviCRM log any modifications to this table in the civicrm_log table. |
e501603b TO |
49 | * |
50 | * @var boolean | |
51 | */ | |
52 | static $_log = false; | |
53 | /** | |
54 | * | |
55 | * @var int unsigned | |
56 | */ | |
57 | public $id; | |
58 | /** | |
59 | * FK to EventQueue | |
60 | * | |
61 | * @var int unsigned | |
62 | */ | |
63 | public $event_queue_id; | |
64 | /** | |
65 | * What type of bounce was it? | |
66 | * | |
67 | * @var int unsigned | |
68 | */ | |
69 | public $bounce_type_id; | |
70 | /** | |
71 | * The reason the email bounced. | |
72 | * | |
73 | * @var string | |
74 | */ | |
75 | public $bounce_reason; | |
76 | /** | |
77 | * When this bounce event occurred. | |
78 | * | |
79 | * @var datetime | |
80 | */ | |
81 | public $time_stamp; | |
82 | /** | |
f41f0342 | 83 | * Class constructor. |
e501603b TO |
84 | */ |
85 | function __construct() { | |
86 | $this->__table = 'civicrm_mailing_event_bounce'; | |
87 | parent::__construct(); | |
88 | } | |
89 | /** | |
f41f0342 | 90 | * Returns foreign keys and entity references. |
e501603b TO |
91 | * |
92 | * @return array | |
93 | * [CRM_Core_Reference_Interface] | |
94 | */ | |
95 | static function getReferenceColumns() { | |
346aaaba TO |
96 | if (!isset(Civi::$statics[__CLASS__]['links'])) { |
97 | Civi::$statics[__CLASS__]['links'] = static ::createReferenceColumns(__CLASS__); | |
98 | Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName() , 'event_queue_id', 'civicrm_mailing_event_queue', 'id'); | |
99 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']); | |
e501603b | 100 | } |
346aaaba | 101 | return Civi::$statics[__CLASS__]['links']; |
e501603b TO |
102 | } |
103 | /** | |
104 | * Returns all the column names of this table | |
105 | * | |
106 | * @return array | |
107 | */ | |
108 | static function &fields() { | |
346aaaba TO |
109 | if (!isset(Civi::$statics[__CLASS__]['fields'])) { |
110 | Civi::$statics[__CLASS__]['fields'] = array( | |
e501603b TO |
111 | 'id' => array( |
112 | 'name' => 'id', | |
113 | 'type' => CRM_Utils_Type::T_INT, | |
114 | 'title' => ts('Bounce ID') , | |
115 | 'required' => true, | |
522a26c9 | 116 | 'table_name' => 'civicrm_mailing_event_bounce', |
117 | 'entity' => 'Bounce', | |
118 | 'bao' => 'CRM_Mailing_Event_BAO_Bounce', | |
6a7e5e5d | 119 | 'localizable' => 0, |
e501603b TO |
120 | ) , |
121 | 'event_queue_id' => array( | |
122 | 'name' => 'event_queue_id', | |
123 | 'type' => CRM_Utils_Type::T_INT, | |
124 | 'title' => ts('Event Queue') , | |
125 | 'description' => 'FK to EventQueue', | |
126 | 'required' => true, | |
522a26c9 | 127 | 'table_name' => 'civicrm_mailing_event_bounce', |
128 | 'entity' => 'Bounce', | |
129 | 'bao' => 'CRM_Mailing_Event_BAO_Bounce', | |
6a7e5e5d | 130 | 'localizable' => 0, |
e501603b TO |
131 | 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue', |
132 | ) , | |
133 | 'bounce_type_id' => array( | |
134 | 'name' => 'bounce_type_id', | |
135 | 'type' => CRM_Utils_Type::T_INT, | |
136 | 'title' => ts('Bounce Type') , | |
137 | 'description' => 'What type of bounce was it?', | |
522a26c9 | 138 | 'table_name' => 'civicrm_mailing_event_bounce', |
139 | 'entity' => 'Bounce', | |
140 | 'bao' => 'CRM_Mailing_Event_BAO_Bounce', | |
6a7e5e5d | 141 | 'localizable' => 0, |
e501603b TO |
142 | 'html' => array( |
143 | 'type' => 'Select', | |
144 | ) , | |
145 | 'pseudoconstant' => array( | |
146 | 'table' => 'civicrm_mailing_bounce_type', | |
147 | 'keyColumn' => 'id', | |
148 | 'labelColumn' => 'name', | |
149 | ) | |
150 | ) , | |
151 | 'bounce_reason' => array( | |
152 | 'name' => 'bounce_reason', | |
153 | 'type' => CRM_Utils_Type::T_STRING, | |
154 | 'title' => ts('Bounce Reason') , | |
155 | 'description' => 'The reason the email bounced.', | |
156 | 'maxlength' => 255, | |
157 | 'size' => CRM_Utils_Type::HUGE, | |
522a26c9 | 158 | 'table_name' => 'civicrm_mailing_event_bounce', |
159 | 'entity' => 'Bounce', | |
160 | 'bao' => 'CRM_Mailing_Event_BAO_Bounce', | |
6a7e5e5d | 161 | 'localizable' => 0, |
e501603b TO |
162 | ) , |
163 | 'time_stamp' => array( | |
164 | 'name' => 'time_stamp', | |
165 | 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME, | |
166 | 'title' => ts('Timestamp') , | |
167 | 'description' => 'When this bounce event occurred.', | |
168 | 'required' => true, | |
522a26c9 | 169 | 'table_name' => 'civicrm_mailing_event_bounce', |
170 | 'entity' => 'Bounce', | |
171 | 'bao' => 'CRM_Mailing_Event_BAO_Bounce', | |
6a7e5e5d | 172 | 'localizable' => 0, |
e501603b TO |
173 | ) , |
174 | ); | |
346aaaba | 175 | CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']); |
e501603b | 176 | } |
346aaaba | 177 | return Civi::$statics[__CLASS__]['fields']; |
e501603b TO |
178 | } |
179 | /** | |
bd8e0b14 | 180 | * Return a mapping from field-name to the corresponding key (as used in fields()). |
e501603b TO |
181 | * |
182 | * @return array | |
bd8e0b14 | 183 | * Array(string $name => string $uniqueName). |
e501603b TO |
184 | */ |
185 | static function &fieldKeys() { | |
bd8e0b14 TO |
186 | if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) { |
187 | Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields())); | |
e501603b | 188 | } |
bd8e0b14 | 189 | return Civi::$statics[__CLASS__]['fieldKeys']; |
e501603b TO |
190 | } |
191 | /** | |
192 | * Returns the names of this table | |
193 | * | |
194 | * @return string | |
195 | */ | |
196 | static function getTableName() { | |
197 | return self::$_tableName; | |
198 | } | |
199 | /** | |
200 | * Returns if this table needs to be logged | |
201 | * | |
202 | * @return boolean | |
203 | */ | |
204 | function getLog() { | |
205 | return self::$_log; | |
206 | } | |
207 | /** | |
208 | * Returns the list of fields that can be imported | |
209 | * | |
210 | * @param bool $prefix | |
211 | * | |
212 | * @return array | |
213 | */ | |
214 | static function &import($prefix = false) { | |
60808919 TO |
215 | $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_bounce', $prefix, array()); |
216 | return $r; | |
e501603b TO |
217 | } |
218 | /** | |
219 | * Returns the list of fields that can be exported | |
220 | * | |
221 | * @param bool $prefix | |
222 | * | |
223 | * @return array | |
224 | */ | |
225 | static function &export($prefix = false) { | |
60808919 TO |
226 | $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_bounce', $prefix, array()); |
227 | return $r; | |
e501603b | 228 | } |
e7a6b91a AS |
229 | /** |
230 | * Returns the list of indices | |
231 | */ | |
232 | public static function indices($localize = TRUE) { | |
233 | $indices = array(); | |
234 | return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices; | |
235 | } | |
e501603b | 236 | } |