Merge pull request #14326 from civicrm/5.14
[civicrm-core.git] / CRM / Mailing / Event / DAO / Bounce.php
CommitLineData
e501603b 1<?php
c3fc2621 2
e501603b
TO
3/**
4 * @package CRM
6b83d5bd 5 * @copyright CiviCRM LLC (c) 2004-2019
e501603b
TO
6 *
7 * Generated from xml/schema/CRM/Mailing/Event/Bounce.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
e6ca0a57 9 * (GenCodeChecksum:0b39ada8498cdc95e5eab7a4f060686a)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the Bounce entity.
f41f0342 14 */
e501603b 15class 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 */
fa45b5b9 22 public 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 */
fa45b5b9 29 public static $_log = FALSE;
c3fc2621 30
e501603b 31 /**
e6ca0a57 32 * @var int
e501603b
TO
33 */
34 public $id;
c3fc2621 35
e501603b
TO
36 /**
37 * FK to EventQueue
38 *
e6ca0a57 39 * @var int
e501603b
TO
40 */
41 public $event_queue_id;
c3fc2621 42
e501603b
TO
43 /**
44 * What type of bounce was it?
45 *
e6ca0a57 46 * @var int
e501603b
TO
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 79 if (!isset(Civi::$statics[__CLASS__]['links'])) {
a36434b9 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,
a36434b9 100 'where' => 'civicrm_mailing_event_bounce.id',
522a26c9 101 'table_name' => 'civicrm_mailing_event_bounce',
102 'entity' => 'Bounce',
103 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
6a7e5e5d 104 'localizable' => 0,
c3fc2621
CW
105 ],
106 'event_queue_id' => [
e501603b
TO
107 'name' => 'event_queue_id',
108 'type' => CRM_Utils_Type::T_INT,
c3fc2621 109 'title' => ts('Event Queue'),
215b423e 110 'description' => ts('FK to EventQueue'),
c3fc2621 111 'required' => TRUE,
a36434b9 112 'where' => 'civicrm_mailing_event_bounce.event_queue_id',
522a26c9 113 'table_name' => 'civicrm_mailing_event_bounce',
114 'entity' => 'Bounce',
115 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
6a7e5e5d 116 'localizable' => 0,
e501603b 117 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
c3fc2621
CW
118 ],
119 'bounce_type_id' => [
e501603b
TO
120 'name' => 'bounce_type_id',
121 'type' => CRM_Utils_Type::T_INT,
c3fc2621 122 'title' => ts('Bounce Type'),
215b423e 123 'description' => ts('What type of bounce was it?'),
a36434b9 124 'where' => 'civicrm_mailing_event_bounce.bounce_type_id',
522a26c9 125 'table_name' => 'civicrm_mailing_event_bounce',
126 'entity' => 'Bounce',
127 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
6a7e5e5d 128 'localizable' => 0,
c3fc2621 129 'html' => [
e501603b 130 'type' => 'Select',
c3fc2621
CW
131 ],
132 'pseudoconstant' => [
e501603b
TO
133 'table' => 'civicrm_mailing_bounce_type',
134 'keyColumn' => 'id',
135 'labelColumn' => 'name',
e6ca0a57 136 ],
c3fc2621
CW
137 ],
138 'bounce_reason' => [
e501603b
TO
139 'name' => 'bounce_reason',
140 'type' => CRM_Utils_Type::T_STRING,
c3fc2621 141 'title' => ts('Bounce Reason'),
215b423e 142 'description' => ts('The reason the email bounced.'),
e501603b
TO
143 'maxlength' => 255,
144 'size' => CRM_Utils_Type::HUGE,
a36434b9 145 'where' => 'civicrm_mailing_event_bounce.bounce_reason',
522a26c9 146 'table_name' => 'civicrm_mailing_event_bounce',
147 'entity' => 'Bounce',
148 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
6a7e5e5d 149 'localizable' => 0,
c3fc2621
CW
150 ],
151 'time_stamp' => [
e501603b 152 'name' => 'time_stamp',
6c2b97b7 153 'type' => CRM_Utils_Type::T_TIMESTAMP,
c3fc2621 154 'title' => ts('Timestamp'),
215b423e 155 'description' => ts('When this bounce event occurred.'),
c3fc2621 156 'required' => TRUE,
a36434b9 157 'where' => 'civicrm_mailing_event_bounce.time_stamp',
6c2b97b7 158 'default' => 'CURRENT_TIMESTAMP',
522a26c9 159 'table_name' => 'civicrm_mailing_event_bounce',
160 'entity' => 'Bounce',
161 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
6a7e5e5d 162 'localizable' => 0,
c3fc2621
CW
163 ],
164 ];
346aaaba 165 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 166 }
346aaaba 167 return Civi::$statics[__CLASS__]['fields'];
e501603b 168 }
c3fc2621 169
e501603b 170 /**
bd8e0b14 171 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
172 *
173 * @return array
bd8e0b14 174 * Array(string $name => string $uniqueName).
e501603b 175 */
c3fc2621 176 public static function &fieldKeys() {
bd8e0b14
TO
177 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
178 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 179 }
bd8e0b14 180 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 181 }
c3fc2621 182
e501603b
TO
183 /**
184 * Returns the names of this table
185 *
186 * @return string
187 */
c3fc2621 188 public static function getTableName() {
e501603b
TO
189 return self::$_tableName;
190 }
c3fc2621 191
e501603b
TO
192 /**
193 * Returns if this table needs to be logged
194 *
c3fc2621 195 * @return bool
e501603b 196 */
c3fc2621 197 public function getLog() {
e501603b
TO
198 return self::$_log;
199 }
c3fc2621 200
e501603b
TO
201 /**
202 * Returns the list of fields that can be imported
203 *
204 * @param bool $prefix
205 *
206 * @return array
207 */
c3fc2621
CW
208 public static function &import($prefix = FALSE) {
209 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_bounce', $prefix, []);
60808919 210 return $r;
e501603b 211 }
c3fc2621 212
e501603b
TO
213 /**
214 * Returns the list of fields that can be exported
215 *
216 * @param bool $prefix
217 *
218 * @return array
219 */
c3fc2621
CW
220 public static function &export($prefix = FALSE) {
221 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_bounce', $prefix, []);
60808919 222 return $r;
e501603b 223 }
c3fc2621 224
e7a6b91a
AS
225 /**
226 * Returns the list of indices
c3fc2621
CW
227 *
228 * @param bool $localize
229 *
230 * @return array
e7a6b91a
AS
231 */
232 public static function indices($localize = TRUE) {
c3fc2621 233 $indices = [];
e7a6b91a
AS
234 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
235 }
c3fc2621 236
e501603b 237}