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