5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/Event/Bounce.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:7e29193742f438beea9f09856d9c7221)
13 * Database access object for the Bounce entity.
15 class CRM_Mailing_Event_DAO_Bounce
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '';
18 const COMPONENT
= 'CiviMail';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_mailing_event_bounce';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = FALSE;
44 public $event_queue_id;
47 * What type of bounce was it?
51 public $bounce_type_id;
54 * The reason the email bounced.
58 public $bounce_reason;
61 * When this bounce event occurred.
70 public function __construct() {
71 $this->__table
= 'civicrm_mailing_event_bounce';
72 parent
::__construct();
76 * Returns localized title of this entity.
79 * Whether to return the plural version of the title.
81 public static function getEntityTitle($plural = FALSE) {
82 return $plural ?
ts('Mailing Bounce Events') : ts('Mailing Bounce Event');
86 * Returns foreign keys and entity references.
89 * [CRM_Core_Reference_Interface]
91 public static function getReferenceColumns() {
92 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
93 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
94 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id');
95 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
97 return Civi
::$statics[__CLASS__
]['links'];
101 * Returns all the column names of this table
105 public static function &fields() {
106 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
107 Civi
::$statics[__CLASS__
]['fields'] = [
110 'type' => CRM_Utils_Type
::T_INT
,
111 'title' => ts('Bounce ID'),
113 'where' => 'civicrm_mailing_event_bounce.id',
114 'table_name' => 'civicrm_mailing_event_bounce',
115 'entity' => 'Bounce',
116 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
124 'event_queue_id' => [
125 'name' => 'event_queue_id',
126 'type' => CRM_Utils_Type
::T_INT
,
127 'title' => ts('Event Queue ID'),
128 'description' => ts('FK to EventQueue'),
130 'where' => 'civicrm_mailing_event_bounce.event_queue_id',
131 'table_name' => 'civicrm_mailing_event_bounce',
132 'entity' => 'Bounce',
133 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
135 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
137 'label' => ts("Event Queue"),
141 'bounce_type_id' => [
142 'name' => 'bounce_type_id',
143 'type' => CRM_Utils_Type
::T_INT
,
144 'title' => ts('Bounce Type'),
145 'description' => ts('What type of bounce was it?'),
146 'where' => 'civicrm_mailing_event_bounce.bounce_type_id',
147 'table_name' => 'civicrm_mailing_event_bounce',
148 'entity' => 'Bounce',
149 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
154 'pseudoconstant' => [
155 'table' => 'civicrm_mailing_bounce_type',
157 'labelColumn' => 'name',
162 'name' => 'bounce_reason',
163 'type' => CRM_Utils_Type
::T_STRING
,
164 'title' => ts('Bounce Reason'),
165 'description' => ts('The reason the email bounced.'),
167 'size' => CRM_Utils_Type
::HUGE
,
168 'where' => 'civicrm_mailing_event_bounce.bounce_reason',
169 'table_name' => 'civicrm_mailing_event_bounce',
170 'entity' => 'Bounce',
171 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
176 'name' => 'time_stamp',
177 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
178 'title' => ts('Timestamp'),
179 'description' => ts('When this bounce event occurred.'),
181 'where' => 'civicrm_mailing_event_bounce.time_stamp',
182 'default' => 'CURRENT_TIMESTAMP',
183 'table_name' => 'civicrm_mailing_event_bounce',
184 'entity' => 'Bounce',
185 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
190 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
192 return Civi
::$statics[__CLASS__
]['fields'];
196 * Return a mapping from field-name to the corresponding key (as used in fields()).
199 * Array(string $name => string $uniqueName).
201 public static function &fieldKeys() {
202 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
203 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
205 return Civi
::$statics[__CLASS__
]['fieldKeys'];
209 * Returns the names of this table
213 public static function getTableName() {
214 return self
::$_tableName;
218 * Returns if this table needs to be logged
222 public function getLog() {
227 * Returns the list of fields that can be imported
229 * @param bool $prefix
233 public static function &import($prefix = FALSE) {
234 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_bounce', $prefix, []);
239 * Returns the list of fields that can be exported
241 * @param bool $prefix
245 public static function &export($prefix = FALSE) {
246 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_bounce', $prefix, []);
251 * Returns the list of indices
253 * @param bool $localize
257 public static function indices($localize = TRUE) {
259 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;