f062ac4e7859462dc8f47c87fcc6e4865d8730d4
[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-2017 |
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-2017
30 *
31 * Generated from xml/schema/CRM/Mailing/Event/Bounce.xml
32 * DO NOT EDIT. Generated by CRM_Core_CodeGen
33 * (GenCodeChecksum:b3ece7fb5a8c702f3a9c8e4bef1a38ca)
34 */
35 require_once 'CRM/Core/DAO.php';
36 require_once 'CRM/Utils/Type.php';
37 /**
38 * CRM_Mailing_Event_DAO_Bounce constructor.
39 */
40 class CRM_Mailing_Event_DAO_Bounce extends CRM_Core_DAO {
41 /**
42 * Static instance to hold the table name.
43 *
44 * @var string
45 */
46 static $_tableName = 'civicrm_mailing_event_bounce';
47 /**
48 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 /**
83 * Class constructor.
84 */
85 function __construct() {
86 $this->__table = 'civicrm_mailing_event_bounce';
87 parent::__construct();
88 }
89 /**
90 * Returns foreign keys and entity references.
91 *
92 * @return array
93 * [CRM_Core_Reference_Interface]
94 */
95 static function getReferenceColumns() {
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']);
100 }
101 return Civi::$statics[__CLASS__]['links'];
102 }
103 /**
104 * Returns all the column names of this table
105 *
106 * @return array
107 */
108 static function &fields() {
109 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
110 Civi::$statics[__CLASS__]['fields'] = array(
111 'id' => array(
112 'name' => 'id',
113 'type' => CRM_Utils_Type::T_INT,
114 'title' => ts('Bounce ID') ,
115 'required' => true,
116 'table_name' => 'civicrm_mailing_event_bounce',
117 'entity' => 'Bounce',
118 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
119 ) ,
120 'event_queue_id' => array(
121 'name' => 'event_queue_id',
122 'type' => CRM_Utils_Type::T_INT,
123 'title' => ts('Event Queue') ,
124 'description' => 'FK to EventQueue',
125 'required' => true,
126 'table_name' => 'civicrm_mailing_event_bounce',
127 'entity' => 'Bounce',
128 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
129 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
130 ) ,
131 'bounce_type_id' => array(
132 'name' => 'bounce_type_id',
133 'type' => CRM_Utils_Type::T_INT,
134 'title' => ts('Bounce Type') ,
135 'description' => 'What type of bounce was it?',
136 'table_name' => 'civicrm_mailing_event_bounce',
137 'entity' => 'Bounce',
138 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
139 'html' => array(
140 'type' => 'Select',
141 ) ,
142 'pseudoconstant' => array(
143 'table' => 'civicrm_mailing_bounce_type',
144 'keyColumn' => 'id',
145 'labelColumn' => 'name',
146 )
147 ) ,
148 'bounce_reason' => array(
149 'name' => 'bounce_reason',
150 'type' => CRM_Utils_Type::T_STRING,
151 'title' => ts('Bounce Reason') ,
152 'description' => 'The reason the email bounced.',
153 'maxlength' => 255,
154 'size' => CRM_Utils_Type::HUGE,
155 'table_name' => 'civicrm_mailing_event_bounce',
156 'entity' => 'Bounce',
157 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
158 ) ,
159 'time_stamp' => array(
160 'name' => 'time_stamp',
161 'type' => CRM_Utils_Type::T_DATE + CRM_Utils_Type::T_TIME,
162 'title' => ts('Timestamp') ,
163 'description' => 'When this bounce event occurred.',
164 'required' => true,
165 'table_name' => 'civicrm_mailing_event_bounce',
166 'entity' => 'Bounce',
167 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
168 ) ,
169 );
170 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
171 }
172 return Civi::$statics[__CLASS__]['fields'];
173 }
174 /**
175 * Return a mapping from field-name to the corresponding key (as used in fields()).
176 *
177 * @return array
178 * Array(string $name => string $uniqueName).
179 */
180 static function &fieldKeys() {
181 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
182 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
183 }
184 return Civi::$statics[__CLASS__]['fieldKeys'];
185 }
186 /**
187 * Returns the names of this table
188 *
189 * @return string
190 */
191 static function getTableName() {
192 return self::$_tableName;
193 }
194 /**
195 * Returns if this table needs to be logged
196 *
197 * @return boolean
198 */
199 function getLog() {
200 return self::$_log;
201 }
202 /**
203 * Returns the list of fields that can be imported
204 *
205 * @param bool $prefix
206 *
207 * @return array
208 */
209 static function &import($prefix = false) {
210 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_bounce', $prefix, array());
211 return $r;
212 }
213 /**
214 * Returns the list of fields that can be exported
215 *
216 * @param bool $prefix
217 *
218 * @return array
219 */
220 static function &export($prefix = false) {
221 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_bounce', $prefix, array());
222 return $r;
223 }
224 }