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:dddc76ba8461f8b0c1f3c1cdccddd111)
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
= '';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_mailing_event_opened';
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 * When this open event occurred.
55 public function __construct() {
56 $this->__table
= 'civicrm_mailing_event_opened';
57 parent
::__construct();
61 * Returns localized title of this entity.
63 public static function getEntityTitle() {
68 * Returns foreign keys and entity references.
71 * [CRM_Core_Reference_Interface]
73 public static function getReferenceColumns() {
74 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
75 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
76 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id');
77 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
79 return Civi
::$statics[__CLASS__
]['links'];
83 * Returns all the column names of this table
87 public static function &fields() {
88 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
89 Civi
::$statics[__CLASS__
]['fields'] = [
92 'type' => CRM_Utils_Type
::T_INT
,
93 'title' => ts('Mailing Opened ID'),
95 'where' => 'civicrm_mailing_event_opened.id',
96 'table_name' => 'civicrm_mailing_event_opened',
98 'bao' => 'CRM_Mailing_Event_BAO_Opened',
102 'event_queue_id' => [
103 'name' => 'event_queue_id',
104 'type' => CRM_Utils_Type
::T_INT
,
105 'title' => ts('Event Queue'),
106 'description' => ts('FK to EventQueue'),
108 'where' => 'civicrm_mailing_event_opened.event_queue_id',
109 'table_name' => 'civicrm_mailing_event_opened',
110 'entity' => 'Opened',
111 'bao' => 'CRM_Mailing_Event_BAO_Opened',
113 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
117 'name' => 'time_stamp',
118 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
119 'title' => ts('Timestamp'),
120 'description' => ts('When this open event occurred.'),
122 'where' => 'civicrm_mailing_event_opened.time_stamp',
123 'default' => 'CURRENT_TIMESTAMP',
124 'table_name' => 'civicrm_mailing_event_opened',
125 'entity' => 'Opened',
126 'bao' => 'CRM_Mailing_Event_BAO_Opened',
131 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
133 return Civi
::$statics[__CLASS__
]['fields'];
137 * Return a mapping from field-name to the corresponding key (as used in fields()).
140 * Array(string $name => string $uniqueName).
142 public static function &fieldKeys() {
143 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
144 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
146 return Civi
::$statics[__CLASS__
]['fieldKeys'];
150 * Returns the names of this table
154 public static function getTableName() {
155 return self
::$_tableName;
159 * Returns if this table needs to be logged
163 public function getLog() {
168 * Returns the list of fields that can be imported
170 * @param bool $prefix
174 public static function &import($prefix = FALSE) {
175 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_opened', $prefix, []);
180 * Returns the list of fields that can be exported
182 * @param bool $prefix
186 public static function &export($prefix = FALSE) {
187 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_opened', $prefix, []);
192 * Returns the list of indices
194 * @param bool $localize
198 public static function indices($localize = TRUE) {
200 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;