Regenerate DAO files
[civicrm-core.git] / CRM / Mailing / Event / DAO / Opened.php
1 <?php
2
3 /**
4 * @package CRM
5 * @copyright CiviCRM LLC https://civicrm.org/licensing
6 *
7 * Generated from xml/schema/CRM/Mailing/Event/Opened.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:dddc76ba8461f8b0c1f3c1cdccddd111)
10 */
11
12 /**
13 * Database access object for the Opened entity.
14 */
15 class CRM_Mailing_Event_DAO_Opened extends CRM_Core_DAO {
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '';
18
19 /**
20 * Static instance to hold the table name.
21 *
22 * @var string
23 */
24 public static $_tableName = 'civicrm_mailing_event_opened';
25
26 /**
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
28 *
29 * @var bool
30 */
31 public static $_log = FALSE;
32
33 /**
34 * @var int
35 */
36 public $id;
37
38 /**
39 * FK to EventQueue
40 *
41 * @var int
42 */
43 public $event_queue_id;
44
45 /**
46 * When this open event occurred.
47 *
48 * @var timestamp
49 */
50 public $time_stamp;
51
52 /**
53 * Class constructor.
54 */
55 public function __construct() {
56 $this->__table = 'civicrm_mailing_event_opened';
57 parent::__construct();
58 }
59
60 /**
61 * Returns localized title of this entity.
62 */
63 public static function getEntityTitle() {
64 return ts('Openeds');
65 }
66
67 /**
68 * Returns foreign keys and entity references.
69 *
70 * @return array
71 * [CRM_Core_Reference_Interface]
72 */
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']);
78 }
79 return Civi::$statics[__CLASS__]['links'];
80 }
81
82 /**
83 * Returns all the column names of this table
84 *
85 * @return array
86 */
87 public static function &fields() {
88 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
89 Civi::$statics[__CLASS__]['fields'] = [
90 'id' => [
91 'name' => 'id',
92 'type' => CRM_Utils_Type::T_INT,
93 'title' => ts('Mailing Opened ID'),
94 'required' => TRUE,
95 'where' => 'civicrm_mailing_event_opened.id',
96 'table_name' => 'civicrm_mailing_event_opened',
97 'entity' => 'Opened',
98 'bao' => 'CRM_Mailing_Event_BAO_Opened',
99 'localizable' => 0,
100 'add' => NULL,
101 ],
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'),
107 'required' => TRUE,
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',
112 'localizable' => 0,
113 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
114 'add' => NULL,
115 ],
116 'time_stamp' => [
117 'name' => 'time_stamp',
118 'type' => CRM_Utils_Type::T_TIMESTAMP,
119 'title' => ts('Timestamp'),
120 'description' => ts('When this open event occurred.'),
121 'required' => TRUE,
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',
127 'localizable' => 0,
128 'add' => NULL,
129 ],
130 ];
131 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
132 }
133 return Civi::$statics[__CLASS__]['fields'];
134 }
135
136 /**
137 * Return a mapping from field-name to the corresponding key (as used in fields()).
138 *
139 * @return array
140 * Array(string $name => string $uniqueName).
141 */
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()));
145 }
146 return Civi::$statics[__CLASS__]['fieldKeys'];
147 }
148
149 /**
150 * Returns the names of this table
151 *
152 * @return string
153 */
154 public static function getTableName() {
155 return self::$_tableName;
156 }
157
158 /**
159 * Returns if this table needs to be logged
160 *
161 * @return bool
162 */
163 public function getLog() {
164 return self::$_log;
165 }
166
167 /**
168 * Returns the list of fields that can be imported
169 *
170 * @param bool $prefix
171 *
172 * @return array
173 */
174 public static function &import($prefix = FALSE) {
175 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_opened', $prefix, []);
176 return $r;
177 }
178
179 /**
180 * Returns the list of fields that can be exported
181 *
182 * @param bool $prefix
183 *
184 * @return array
185 */
186 public static function &export($prefix = FALSE) {
187 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_opened', $prefix, []);
188 return $r;
189 }
190
191 /**
192 * Returns the list of indices
193 *
194 * @param bool $localize
195 *
196 * @return array
197 */
198 public static function indices($localize = TRUE) {
199 $indices = [];
200 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
201 }
202
203 }