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