5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/Event/Opened.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:eb80ba7a01169cc0320fb2807c873291)
13 * Database access object for the Opened entity.
15 class CRM_Mailing_Event_DAO_Opened
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_opened';
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 open event occurred.
56 public function __construct() {
57 $this->__table
= 'civicrm_mailing_event_opened';
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 Opened Events') : ts('Mailing Opened 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('Mailing Opened ID'),
99 'where' => 'civicrm_mailing_event_opened.id',
100 'table_name' => 'civicrm_mailing_event_opened',
101 'entity' => 'Opened',
102 'bao' => 'CRM_Mailing_Event_BAO_Opened',
110 'event_queue_id' => [
111 'name' => 'event_queue_id',
112 'type' => CRM_Utils_Type
::T_INT
,
113 'title' => ts('Event Queue ID'),
114 'description' => ts('FK to EventQueue'),
116 'where' => 'civicrm_mailing_event_opened.event_queue_id',
117 'table_name' => 'civicrm_mailing_event_opened',
118 'entity' => 'Opened',
119 'bao' => 'CRM_Mailing_Event_BAO_Opened',
121 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
123 'label' => ts("Event Queue"),
128 'name' => 'time_stamp',
129 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
130 'title' => ts('Timestamp'),
131 'description' => ts('When this open event occurred.'),
133 'where' => 'civicrm_mailing_event_opened.time_stamp',
134 'default' => 'CURRENT_TIMESTAMP',
135 'table_name' => 'civicrm_mailing_event_opened',
136 'entity' => 'Opened',
137 'bao' => 'CRM_Mailing_Event_BAO_Opened',
142 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
144 return Civi
::$statics[__CLASS__
]['fields'];
148 * Return a mapping from field-name to the corresponding key (as used in fields()).
151 * Array(string $name => string $uniqueName).
153 public static function &fieldKeys() {
154 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
155 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
157 return Civi
::$statics[__CLASS__
]['fieldKeys'];
161 * Returns the names of this table
165 public static function getTableName() {
166 return self
::$_tableName;
170 * Returns if this table needs to be logged
174 public function getLog() {
179 * Returns the list of fields that can be imported
181 * @param bool $prefix
185 public static function &import($prefix = FALSE) {
186 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_opened', $prefix, []);
191 * Returns the list of fields that can be exported
193 * @param bool $prefix
197 public static function &export($prefix = FALSE) {
198 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_opened', $prefix, []);
203 * Returns the list of indices
205 * @param bool $localize
209 public static function indices($localize = TRUE) {
211 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;