5 * @copyright CiviCRM LLC (c) 2004-2018
7 * Generated from xml/schema/CRM/Mailing/Event/Bounce.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:5243c65d5b727e60e1fdedb9fa3e84e2)
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 static $_tableName = 'civicrm_mailing_event_bounce';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
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 'table_name' => 'civicrm_mailing_event_bounce',
101 'entity' => 'Bounce',
102 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
105 'event_queue_id' => [
106 'name' => 'event_queue_id',
107 'type' => CRM_Utils_Type
::T_INT
,
108 'title' => ts('Event Queue'),
109 'description' => ts('FK to EventQueue'),
111 'table_name' => 'civicrm_mailing_event_bounce',
112 'entity' => 'Bounce',
113 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
115 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
117 'bounce_type_id' => [
118 'name' => 'bounce_type_id',
119 'type' => CRM_Utils_Type
::T_INT
,
120 'title' => ts('Bounce Type'),
121 'description' => ts('What type of bounce was it?'),
122 'table_name' => 'civicrm_mailing_event_bounce',
123 'entity' => 'Bounce',
124 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
129 'pseudoconstant' => [
130 'table' => 'civicrm_mailing_bounce_type',
132 'labelColumn' => 'name',
136 'name' => 'bounce_reason',
137 'type' => CRM_Utils_Type
::T_STRING
,
138 'title' => ts('Bounce Reason'),
139 'description' => ts('The reason the email bounced.'),
141 'size' => CRM_Utils_Type
::HUGE
,
142 'table_name' => 'civicrm_mailing_event_bounce',
143 'entity' => 'Bounce',
144 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
148 'name' => 'time_stamp',
149 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
150 'title' => ts('Timestamp'),
151 'description' => ts('When this bounce event occurred.'),
153 'default' => 'CURRENT_TIMESTAMP',
154 'table_name' => 'civicrm_mailing_event_bounce',
155 'entity' => 'Bounce',
156 'bao' => 'CRM_Mailing_Event_BAO_Bounce',
160 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
162 return Civi
::$statics[__CLASS__
]['fields'];
166 * Return a mapping from field-name to the corresponding key (as used in fields()).
169 * Array(string $name => string $uniqueName).
171 public static function &fieldKeys() {
172 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
173 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
175 return Civi
::$statics[__CLASS__
]['fieldKeys'];
179 * Returns the names of this table
183 public static function getTableName() {
184 return self
::$_tableName;
188 * Returns if this table needs to be logged
192 public function getLog() {
197 * Returns the list of fields that can be imported
199 * @param bool $prefix
203 public static function &import($prefix = FALSE) {
204 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_bounce', $prefix, []);
209 * Returns the list of fields that can be exported
211 * @param bool $prefix
215 public static function &export($prefix = FALSE) {
216 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_bounce', $prefix, []);
221 * Returns the list of indices
223 * @param bool $localize
227 public static function indices($localize = TRUE) {
229 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;