5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/Event/Delivered.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:9f53cffbe35f2c67187ab62cceff6f34)
13 * Database access object for the Delivered entity.
15 class CRM_Mailing_Event_DAO_Delivered
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_delivered';
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 * When this delivery event occurred.
56 public function __construct() {
57 $this->__table
= 'civicrm_mailing_event_delivered';
58 parent
::__construct();
62 * Returns localized title of this entity.
65 * Whether to return the plural version of the title.
67 public static function getEntityTitle($plural = FALSE) {
68 return $plural ?
ts('Mailing Delivery Events') : ts('Mailing Delivery Event');
72 * Returns foreign keys and entity references.
75 * [CRM_Core_Reference_Interface]
77 public static function getReferenceColumns() {
78 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
79 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
80 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id');
81 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
83 return Civi
::$statics[__CLASS__
]['links'];
87 * Returns all the column names of this table
91 public static function &fields() {
92 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
93 Civi
::$statics[__CLASS__
]['fields'] = [
96 'type' => CRM_Utils_Type
::T_INT
,
97 'title' => ts('Delivered ID'),
99 'where' => 'civicrm_mailing_event_delivered.id',
100 'table_name' => 'civicrm_mailing_event_delivered',
101 'entity' => 'Delivered',
102 'bao' => 'CRM_Mailing_Event_BAO_Delivered',
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_delivered.event_queue_id',
113 'table_name' => 'civicrm_mailing_event_delivered',
114 'entity' => 'Delivered',
115 'bao' => 'CRM_Mailing_Event_BAO_Delivered',
117 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
121 'name' => 'time_stamp',
122 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
123 'title' => ts('Timestamp'),
124 'description' => ts('When this delivery event occurred.'),
126 'where' => 'civicrm_mailing_event_delivered.time_stamp',
127 'default' => 'CURRENT_TIMESTAMP',
128 'table_name' => 'civicrm_mailing_event_delivered',
129 'entity' => 'Delivered',
130 'bao' => 'CRM_Mailing_Event_BAO_Delivered',
135 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
137 return Civi
::$statics[__CLASS__
]['fields'];
141 * Return a mapping from field-name to the corresponding key (as used in fields()).
144 * Array(string $name => string $uniqueName).
146 public static function &fieldKeys() {
147 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
148 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
150 return Civi
::$statics[__CLASS__
]['fieldKeys'];
154 * Returns the names of this table
158 public static function getTableName() {
159 return self
::$_tableName;
163 * Returns if this table needs to be logged
167 public function getLog() {
172 * Returns the list of fields that can be imported
174 * @param bool $prefix
178 public static function &import($prefix = FALSE) {
179 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_delivered', $prefix, []);
184 * Returns the list of fields that can be exported
186 * @param bool $prefix
190 public static function &export($prefix = FALSE) {
191 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_delivered', $prefix, []);
196 * Returns the list of indices
198 * @param bool $localize
202 public static function indices($localize = TRUE) {
204 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;