CRM-14885 - Import DAO's
[civicrm-core.git] / CRM / Mailing / Event / DAO / Bounce.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 4.7 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2016 |
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
29 * @copyright CiviCRM LLC (c) 2004-2016
30 *
31 * Generated from xml/schema/CRM/Mailing/Event/Bounce.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:69f76cd03a5376a4ba729a77487e7eeb)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 class CRM_Mailing_Event_DAO_Bounce extends CRM_Core_DAO {
38 /**
39 * static instance to hold the table name
40 *
41 * @var string
42 */
43 static $_tableName = 'civicrm_mailing_event_bounce';
44 /**
45 * static instance to hold the field values
46 *
47 * @var array
48 */
49 static $_fields = null;
50 /**
51 * static instance to hold the keys used in $_fields for each field.
52 *
53 * @var array
54 */
55 static $_fieldKeys = null;
56 /**
57 * static instance to hold the FK relationships
58 *
59 * @var string
60 */
61 static $_links = null;
62 /**
63 * static instance to hold the values that can
64 * be imported
65 *
66 * @var array
67 */
68 static $_import = null;
69 /**
70 * static instance to hold the values that can
71 * be exported
72 *
73 * @var array
74 */
75 static $_export = null;
76 /**
77 * static value to see if we should log any modifications to
78 * this table in the civicrm_log table
79 *
80 * @var boolean
81 */
82 static $_log = false;
83 /**
84 *
85 * @var int unsigned
86 */
87 public $id;
88 /**
89 * FK to EventQueue
90 *
91 * @var int unsigned
92 */
93 public $event_queue_id;
94 /**
95 * What type of bounce was it?
96 *
97 * @var int unsigned
98 */
99 public $bounce_type_id;
100 /**
101 * The reason the email bounced.
102 *
103 * @var string
104 */
105 public $bounce_reason;
106 /**
107 * When this bounce event occurred.
108 *
109 * @var datetime
110 */
111 public $time_stamp;
112 /**
113 * class constructor
114 *
115 * @return civicrm_mailing_event_bounce
116 */
117 function __construct() {
118 $this->__table = 'civicrm_mailing_event_bounce';
119 parent::__construct();
120 }
121 /**
122 * Returns foreign keys and entity references
123 *
124 * @return array
125 * [CRM_Core_Reference_Interface]
126 */
127 static function getReferenceColumns() {
128 if (!self::$_links) {
129 self::$_links = static ::createReferenceColumns(__CLASS__);
130 self::$_links[] = new CRM_Core_Reference_Basic(self::getTableName() , 'event_queue_id', 'civicrm_mailing_event_queue', 'id');
131 }
132 return self::$_links;
133 }
134 /**
135 * Returns all the column names of this table
136 *
137 * @return array
138 */
139 static function &fields() {
140 if (!(self::$_fields)) {
141 self::$_fields = array(
142 'id' => array(
143 'name' => 'id',
144 'type' => CRM_Utils_Type::T_INT,
145 'title' => ts('Bounce ID') ,
146 'required' => true,
147 ) ,
148 'event_queue_id' => array(
149 'name' => 'event_queue_id',
150 'type' => CRM_Utils_Type::T_INT,
151 'title' => ts('Event Queue') ,
152 'description' => 'FK to EventQueue',
153 'required' => true,
154 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
155 ) ,
156 'bounce_type_id' => array(
157 'name' => 'bounce_type_id',
158 'type' => CRM_Utils_Type::T_INT,
159 'title' => ts('Bounce Type') ,
160 'description' => 'What type of bounce was it?',
161 'html' => array(
162 'type' => 'Select',
163 ) ,
164 'pseudoconstant' => array(
165 'table' => 'civicrm_mailing_bounce_type',
166 'keyColumn' => 'id',
167 'labelColumn' => 'name',
168 )
169 ) ,
170 'bounce_reason' => array(
171 'name' => 'bounce_reason',
172 'type' => CRM_Utils_Type::T_STRING,
173 'title' => ts('Bounce Reason') ,
174 'description' => 'The reason the email bounced.',
175 'maxlength' => 255,
176 'size' => CRM_Utils_Type::HUGE,
177 ) ,
178 'time_stamp' => array(
179 'name' => 'time_stamp',
180 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
181 'title' => ts('Timestamp') ,
182 'description' => 'When this bounce event occurred.',
183 'required' => true,
184 ) ,
185 );
186 }
187 return self::$_fields;
188 }
189 /**
190 * Returns an array containing, for each field, the arary key used for that
191 * field in self::$_fields.
192 *
193 * @return array
194 */
195 static function &fieldKeys() {
196 if (!(self::$_fieldKeys)) {
197 self::$_fieldKeys = array(
198 'id' => 'id',
199 'event_queue_id' => 'event_queue_id',
200 'bounce_type_id' => 'bounce_type_id',
201 'bounce_reason' => 'bounce_reason',
202 'time_stamp' => 'time_stamp',
203 );
204 }
205 return self::$_fieldKeys;
206 }
207 /**
208 * Returns the names of this table
209 *
210 * @return string
211 */
212 static function getTableName() {
213 return self::$_tableName;
214 }
215 /**
216 * Returns if this table needs to be logged
217 *
218 * @return boolean
219 */
220 function getLog() {
221 return self::$_log;
222 }
223 /**
224 * Returns the list of fields that can be imported
225 *
226 * @param bool $prefix
227 *
228 * @return array
229 */
230 static function &import($prefix = false) {
231 if (!(self::$_import)) {
232 self::$_import = array();
233 $fields = self::fields();
234 foreach($fields as $name => $field) {
235 if (CRM_Utils_Array::value('import', $field)) {
236 if ($prefix) {
237 self::$_import['mailing_event_bounce'] = & $fields[$name];
238 } else {
239 self::$_import[$name] = & $fields[$name];
240 }
241 }
242 }
243 }
244 return self::$_import;
245 }
246 /**
247 * Returns the list of fields that can be exported
248 *
249 * @param bool $prefix
250 *
251 * @return array
252 */
253 static function &export($prefix = false) {
254 if (!(self::$_export)) {
255 self::$_export = array();
256 $fields = self::fields();
257 foreach($fields as $name => $field) {
258 if (CRM_Utils_Array::value('export', $field)) {
259 if ($prefix) {
260 self::$_export['mailing_event_bounce'] = & $fields[$name];
261 } else {
262 self::$_export[$name] = & $fields[$name];
263 }
264 }
265 }
266 }
267 return self::$_export;
268 }
269 }