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