5 * @copyright CiviCRM LLC (c) 2004-2019
7 * Generated from xml/schema/CRM/Mailing/Event/Bounce.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:0b39ada8498cdc95e5eab7a4f060686a)
13 * Database access object for the Bounce entity.
15 class CRM_Mailing_Event_DAO_Bounce
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_mailing_event_bounce';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
41 public $event_queue_id;
44 * What type of bounce was it?
48 public $bounce_type_id;
51 * The reason the email bounced.
55 public $bounce_reason;
58 * When this bounce event occurred.
67 public function __construct() {
68 $this->__table
= 'civicrm_mailing_event_bounce';
69 parent
::__construct();
73 * Returns foreign keys and entity references.
76 * [CRM_Core_Reference_Interface]
78 public static function getReferenceColumns() {
79 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
80 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
81 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id');
82 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
84 return Civi
::$statics[__CLASS__
]['links'];
88 * Returns all the column names of this table
92 public static function &fields() {
93 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
94 Civi
::$statics[__CLASS__
]['fields'] = [
97 'type' => CRM_Utils_Type
::T_INT
,
98 'title' => ts('Bounce ID'),
100 'where' => 'civicrm_mailing_event_bounce.id',
101 'table_name' => 'civicrm_mailing_event_bounce',
102 'entity' => 'Bounce',
103 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
106 'event_queue_id' => [
107 'name' => 'event_queue_id',
108 'type' => CRM_Utils_Type
::T_INT
,
109 'title' => ts('Event Queue'),
110 'description' => ts('FK to EventQueue'),
112 'where' => 'civicrm_mailing_event_bounce.event_queue_id',
113 'table_name' => 'civicrm_mailing_event_bounce',
114 'entity' => 'Bounce',
115 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
117 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
119 'bounce_type_id' => [
120 'name' => 'bounce_type_id',
121 'type' => CRM_Utils_Type
::T_INT
,
122 'title' => ts('Bounce Type'),
123 'description' => ts('What type of bounce was it?'),
124 'where' => 'civicrm_mailing_event_bounce.bounce_type_id',
125 'table_name' => 'civicrm_mailing_event_bounce',
126 'entity' => 'Bounce',
127 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
132 'pseudoconstant' => [
133 'table' => 'civicrm_mailing_bounce_type',
135 'labelColumn' => 'name',
139 'name' => 'bounce_reason',
140 'type' => CRM_Utils_Type
::T_STRING
,
141 'title' => ts('Bounce Reason'),
142 'description' => ts('The reason the email bounced.'),
144 'size' => CRM_Utils_Type
::HUGE
,
145 'where' => 'civicrm_mailing_event_bounce.bounce_reason',
146 'table_name' => 'civicrm_mailing_event_bounce',
147 'entity' => 'Bounce',
148 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
152 'name' => 'time_stamp',
153 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
154 'title' => ts('Timestamp'),
155 'description' => ts('When this bounce event occurred.'),
157 'where' => 'civicrm_mailing_event_bounce.time_stamp',
158 'default' => 'CURRENT_TIMESTAMP',
159 'table_name' => 'civicrm_mailing_event_bounce',
160 'entity' => 'Bounce',
161 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
165 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
167 return Civi
::$statics[__CLASS__
]['fields'];
171 * Return a mapping from field-name to the corresponding key (as used in fields()).
174 * Array(string $name => string $uniqueName).
176 public static function &fieldKeys() {
177 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
178 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
180 return Civi
::$statics[__CLASS__
]['fieldKeys'];
184 * Returns the names of this table
188 public static function getTableName() {
189 return self
::$_tableName;
193 * Returns if this table needs to be logged
197 public function getLog() {
202 * Returns the list of fields that can be imported
204 * @param bool $prefix
208 public static function &import($prefix = FALSE) {
209 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_bounce', $prefix, []);
214 * Returns the list of fields that can be exported
216 * @param bool $prefix
220 public static function &export($prefix = FALSE) {
221 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_bounce', $prefix, []);
226 * Returns the list of indices
228 * @param bool $localize
232 public static function indices($localize = TRUE) {
234 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;