Merge pull request #23274 from civicrm/5.49
[civicrm-core.git] / CRM / Mailing / Event / DAO / TrackableURLOpen.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/TrackableURLOpen.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:a49c335dfa1bde412a6123d715c9ef34)
10 */
11
12 /**
13 * Database access object for the TrackableURLOpen entity.
14 */
15 class CRM_Mailing_Event_DAO_TrackableURLOpen extends CRM_Core_DAO {
16 const EXT = 'civicrm';
17 const TABLE_ADDED = '';
18 const COMPONENT = 'CiviMail';
19
20 /**
21 * Static instance to hold the table name.
22 *
23 * @var string
24 */
25 public static $_tableName = 'civicrm_mailing_event_trackable_url_open';
26
27 /**
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 *
30 * @var bool
31 */
32 public static $_log = FALSE;
33
34 /**
35 * @var int|string|null
36 * (SQL type: int unsigned)
37 * Note that values will be retrieved from the database as a string.
38 */
39 public $id;
40
41 /**
42 * FK to EventQueue
43 *
44 * @var int|string
45 * (SQL type: int unsigned)
46 * Note that values will be retrieved from the database as a string.
47 */
48 public $event_queue_id;
49
50 /**
51 * FK to TrackableURL
52 *
53 * @var int|string
54 * (SQL type: int unsigned)
55 * Note that values will be retrieved from the database as a string.
56 */
57 public $trackable_url_id;
58
59 /**
60 * When this trackable URL open occurred.
61 *
62 * @var string
63 * (SQL type: timestamp)
64 * Note that values will be retrieved from the database as a string.
65 */
66 public $time_stamp;
67
68 /**
69 * Class constructor.
70 */
71 public function __construct() {
72 $this->__table = 'civicrm_mailing_event_trackable_url_open';
73 parent::__construct();
74 }
75
76 /**
77 * Returns localized title of this entity.
78 *
79 * @param bool $plural
80 * Whether to return the plural version of the title.
81 */
82 public static function getEntityTitle($plural = FALSE) {
83 return $plural ? ts('Trackable URLOpens') : ts('Trackable URLOpen');
84 }
85
86 /**
87 * Returns foreign keys and entity references.
88 *
89 * @return array
90 * [CRM_Core_Reference_Interface]
91 */
92 public static function getReferenceColumns() {
93 if (!isset(Civi::$statics[__CLASS__]['links'])) {
94 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
95 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id');
96 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'trackable_url_id', 'civicrm_mailing_trackable_url', 'id');
97 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
98 }
99 return Civi::$statics[__CLASS__]['links'];
100 }
101
102 /**
103 * Returns all the column names of this table
104 *
105 * @return array
106 */
107 public static function &fields() {
108 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
109 Civi::$statics[__CLASS__]['fields'] = [
110 'id' => [
111 'name' => 'id',
112 'type' => CRM_Utils_Type::T_INT,
113 'title' => ts('Trackable URL Open ID'),
114 'required' => TRUE,
115 'where' => 'civicrm_mailing_event_trackable_url_open.id',
116 'table_name' => 'civicrm_mailing_event_trackable_url_open',
117 'entity' => 'TrackableURLOpen',
118 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
119 'localizable' => 0,
120 'html' => [
121 'type' => 'Number',
122 ],
123 'readonly' => TRUE,
124 'add' => NULL,
125 ],
126 'event_queue_id' => [
127 'name' => 'event_queue_id',
128 'type' => CRM_Utils_Type::T_INT,
129 'title' => ts('Event Queue ID'),
130 'description' => ts('FK to EventQueue'),
131 'required' => TRUE,
132 'where' => 'civicrm_mailing_event_trackable_url_open.event_queue_id',
133 'table_name' => 'civicrm_mailing_event_trackable_url_open',
134 'entity' => 'TrackableURLOpen',
135 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
136 'localizable' => 0,
137 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
138 'html' => [
139 'label' => ts("Event Queue"),
140 ],
141 'add' => NULL,
142 ],
143 'trackable_url_id' => [
144 'name' => 'trackable_url_id',
145 'type' => CRM_Utils_Type::T_INT,
146 'title' => ts('Trackable Url ID'),
147 'description' => ts('FK to TrackableURL'),
148 'required' => TRUE,
149 'where' => 'civicrm_mailing_event_trackable_url_open.trackable_url_id',
150 'table_name' => 'civicrm_mailing_event_trackable_url_open',
151 'entity' => 'TrackableURLOpen',
152 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
153 'localizable' => 0,
154 'FKClassName' => 'CRM_Mailing_DAO_TrackableURL',
155 'html' => [
156 'label' => ts("Trackable Url"),
157 ],
158 'add' => NULL,
159 ],
160 'time_stamp' => [
161 'name' => 'time_stamp',
162 'type' => CRM_Utils_Type::T_TIMESTAMP,
163 'title' => ts('Timestamp'),
164 'description' => ts('When this trackable URL open occurred.'),
165 'required' => TRUE,
166 'where' => 'civicrm_mailing_event_trackable_url_open.time_stamp',
167 'default' => 'CURRENT_TIMESTAMP',
168 'table_name' => 'civicrm_mailing_event_trackable_url_open',
169 'entity' => 'TrackableURLOpen',
170 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
171 'localizable' => 0,
172 'add' => NULL,
173 ],
174 ];
175 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
176 }
177 return Civi::$statics[__CLASS__]['fields'];
178 }
179
180 /**
181 * Return a mapping from field-name to the corresponding key (as used in fields()).
182 *
183 * @return array
184 * Array(string $name => string $uniqueName).
185 */
186 public static function &fieldKeys() {
187 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
188 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
189 }
190 return Civi::$statics[__CLASS__]['fieldKeys'];
191 }
192
193 /**
194 * Returns the names of this table
195 *
196 * @return string
197 */
198 public static function getTableName() {
199 return self::$_tableName;
200 }
201
202 /**
203 * Returns if this table needs to be logged
204 *
205 * @return bool
206 */
207 public function getLog() {
208 return self::$_log;
209 }
210
211 /**
212 * Returns the list of fields that can be imported
213 *
214 * @param bool $prefix
215 *
216 * @return array
217 */
218 public static function &import($prefix = FALSE) {
219 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_trackable_url_open', $prefix, []);
220 return $r;
221 }
222
223 /**
224 * Returns the list of fields that can be exported
225 *
226 * @param bool $prefix
227 *
228 * @return array
229 */
230 public static function &export($prefix = FALSE) {
231 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_trackable_url_open', $prefix, []);
232 return $r;
233 }
234
235 /**
236 * Returns the list of indices
237 *
238 * @param bool $localize
239 *
240 * @return array
241 */
242 public static function indices($localize = TRUE) {
243 $indices = [];
244 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
245 }
246
247 }