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