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:dc1c97304810848da9a9c4255456799f)
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
= '';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_mailing_event_bounce';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
43 public $event_queue_id;
46 * What type of bounce was it?
50 public $bounce_type_id;
53 * The reason the email bounced.
57 public $bounce_reason;
60 * When this bounce event occurred.
69 public function __construct() {
70 $this->__table
= 'civicrm_mailing_event_bounce';
71 parent
::__construct();
75 * Returns localized title of this entity.
78 * Whether to return the plural version of the title.
80 public static function getEntityTitle($plural = FALSE) {
81 return $plural ?
ts('Bounces') : ts('Bounce');
85 * Returns foreign keys and entity references.
88 * [CRM_Core_Reference_Interface]
90 public static function getReferenceColumns() {
91 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
92 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
93 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id');
94 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
96 return Civi
::$statics[__CLASS__
]['links'];
100 * Returns all the column names of this table
104 public static function &fields() {
105 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
106 Civi
::$statics[__CLASS__
]['fields'] = [
109 'type' => CRM_Utils_Type
::T_INT
,
110 'title' => ts('Bounce ID'),
112 'where' => 'civicrm_mailing_event_bounce.id',
113 'table_name' => 'civicrm_mailing_event_bounce',
114 'entity' => 'Bounce',
115 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
119 'event_queue_id' => [
120 'name' => 'event_queue_id',
121 'type' => CRM_Utils_Type
::T_INT
,
122 'title' => ts('Event Queue'),
123 'description' => ts('FK to EventQueue'),
125 'where' => 'civicrm_mailing_event_bounce.event_queue_id',
126 'table_name' => 'civicrm_mailing_event_bounce',
127 'entity' => 'Bounce',
128 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
130 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
133 'bounce_type_id' => [
134 'name' => 'bounce_type_id',
135 'type' => CRM_Utils_Type
::T_INT
,
136 'title' => ts('Bounce Type'),
137 'description' => ts('What type of bounce was it?'),
138 'where' => 'civicrm_mailing_event_bounce.bounce_type_id',
139 'table_name' => 'civicrm_mailing_event_bounce',
140 'entity' => 'Bounce',
141 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
146 'pseudoconstant' => [
147 'table' => 'civicrm_mailing_bounce_type',
149 'labelColumn' => 'name',
154 'name' => 'bounce_reason',
155 'type' => CRM_Utils_Type
::T_STRING
,
156 'title' => ts('Bounce Reason'),
157 'description' => ts('The reason the email bounced.'),
159 'size' => CRM_Utils_Type
::HUGE
,
160 'where' => 'civicrm_mailing_event_bounce.bounce_reason',
161 'table_name' => 'civicrm_mailing_event_bounce',
162 'entity' => 'Bounce',
163 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
168 'name' => 'time_stamp',
169 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
170 'title' => ts('Timestamp'),
171 'description' => ts('When this bounce event occurred.'),
173 'where' => 'civicrm_mailing_event_bounce.time_stamp',
174 'default' => 'CURRENT_TIMESTAMP',
175 'table_name' => 'civicrm_mailing_event_bounce',
176 'entity' => 'Bounce',
177 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
182 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
184 return Civi
::$statics[__CLASS__
]['fields'];
188 * Return a mapping from field-name to the corresponding key (as used in fields()).
191 * Array(string $name => string $uniqueName).
193 public static function &fieldKeys() {
194 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
195 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
197 return Civi
::$statics[__CLASS__
]['fieldKeys'];
201 * Returns the names of this table
205 public static function getTableName() {
206 return self
::$_tableName;
210 * Returns if this table needs to be logged
214 public function getLog() {
219 * Returns the list of fields that can be imported
221 * @param bool $prefix
225 public static function &import($prefix = FALSE) {
226 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_bounce', $prefix, []);
231 * Returns the list of fields that can be exported
233 * @param bool $prefix
237 public static function &export($prefix = FALSE) {
238 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_bounce', $prefix, []);
243 * Returns the list of indices
245 * @param bool $localize
249 public static function indices($localize = TRUE) {
251 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;