Merge pull request #15475 from mecachisenros/externUrl
[civicrm-core.git] / CRM / Mailing / Event / DAO / TrackableURLOpen.php
CommitLineData
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
f29bf4f3 9 * (GenCodeChecksum:e3972b32e62b53916079913b418785d9)
e501603b 10 */
c3fc2621 11
f41f0342 12/**
c3fc2621 13 * Database access object for the TrackableURLOpen entity.
f41f0342 14 */
e501603b 15class 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
e501603b 65 /**
f41f0342 66 * Returns foreign keys and entity references.
e501603b
TO
67 *
68 * @return array
69 * [CRM_Core_Reference_Interface]
70 */
c3fc2621 71 public static function getReferenceColumns() {
346aaaba 72 if (!isset(Civi::$statics[__CLASS__]['links'])) {
a36434b9 73 Civi::$statics[__CLASS__]['links'] = static::createReferenceColumns(__CLASS__);
c3fc2621
CW
74 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id');
75 Civi::$statics[__CLASS__]['links'][] = new CRM_Core_Reference_Basic(self::getTableName(), 'trackable_url_id', 'civicrm_mailing_trackable_url', 'id');
346aaaba 76 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'links_callback', Civi::$statics[__CLASS__]['links']);
e501603b 77 }
346aaaba 78 return Civi::$statics[__CLASS__]['links'];
e501603b 79 }
c3fc2621 80
e501603b
TO
81 /**
82 * Returns all the column names of this table
83 *
84 * @return array
85 */
c3fc2621 86 public static function &fields() {
346aaaba 87 if (!isset(Civi::$statics[__CLASS__]['fields'])) {
c3fc2621
CW
88 Civi::$statics[__CLASS__]['fields'] = [
89 'id' => [
e501603b
TO
90 'name' => 'id',
91 'type' => CRM_Utils_Type::T_INT,
c3fc2621
CW
92 'title' => ts('Trackable URL Open ID'),
93 'required' => TRUE,
a36434b9 94 'where' => 'civicrm_mailing_event_trackable_url_open.id',
522a26c9 95 'table_name' => 'civicrm_mailing_event_trackable_url_open',
96 'entity' => 'TrackableURLOpen',
97 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
6a7e5e5d 98 'localizable' => 0,
c3fc2621
CW
99 ],
100 'event_queue_id' => [
e501603b
TO
101 'name' => 'event_queue_id',
102 'type' => CRM_Utils_Type::T_INT,
c3fc2621 103 'title' => ts('Event Queue'),
215b423e 104 'description' => ts('FK to EventQueue'),
c3fc2621 105 'required' => TRUE,
a36434b9 106 'where' => 'civicrm_mailing_event_trackable_url_open.event_queue_id',
522a26c9 107 'table_name' => 'civicrm_mailing_event_trackable_url_open',
108 'entity' => 'TrackableURLOpen',
109 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
6a7e5e5d 110 'localizable' => 0,
e501603b 111 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
c3fc2621
CW
112 ],
113 'trackable_url_id' => [
e501603b
TO
114 'name' => 'trackable_url_id',
115 'type' => CRM_Utils_Type::T_INT,
c3fc2621 116 'title' => ts('Trackable Url'),
215b423e 117 'description' => ts('FK to TrackableURL'),
c3fc2621 118 'required' => TRUE,
a36434b9 119 'where' => 'civicrm_mailing_event_trackable_url_open.trackable_url_id',
522a26c9 120 'table_name' => 'civicrm_mailing_event_trackable_url_open',
121 'entity' => 'TrackableURLOpen',
122 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
6a7e5e5d 123 'localizable' => 0,
e501603b 124 'FKClassName' => 'CRM_Mailing_DAO_TrackableURL',
c3fc2621
CW
125 ],
126 'time_stamp' => [
e501603b 127 'name' => 'time_stamp',
6c2b97b7 128 'type' => CRM_Utils_Type::T_TIMESTAMP,
c3fc2621 129 'title' => ts('Timestamp'),
215b423e 130 'description' => ts('When this trackable URL open occurred.'),
c3fc2621 131 'required' => TRUE,
a36434b9 132 'where' => 'civicrm_mailing_event_trackable_url_open.time_stamp',
6c2b97b7 133 'default' => 'CURRENT_TIMESTAMP',
522a26c9 134 'table_name' => 'civicrm_mailing_event_trackable_url_open',
135 'entity' => 'TrackableURLOpen',
136 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
6a7e5e5d 137 'localizable' => 0,
c3fc2621
CW
138 ],
139 ];
346aaaba 140 CRM_Core_DAO_AllCoreTables::invoke(__CLASS__, 'fields_callback', Civi::$statics[__CLASS__]['fields']);
e501603b 141 }
346aaaba 142 return Civi::$statics[__CLASS__]['fields'];
e501603b 143 }
c3fc2621 144
e501603b 145 /**
bd8e0b14 146 * Return a mapping from field-name to the corresponding key (as used in fields()).
e501603b
TO
147 *
148 * @return array
bd8e0b14 149 * Array(string $name => string $uniqueName).
e501603b 150 */
c3fc2621 151 public static function &fieldKeys() {
bd8e0b14
TO
152 if (!isset(Civi::$statics[__CLASS__]['fieldKeys'])) {
153 Civi::$statics[__CLASS__]['fieldKeys'] = array_flip(CRM_Utils_Array::collect('name', self::fields()));
e501603b 154 }
bd8e0b14 155 return Civi::$statics[__CLASS__]['fieldKeys'];
e501603b 156 }
c3fc2621 157
e501603b
TO
158 /**
159 * Returns the names of this table
160 *
161 * @return string
162 */
c3fc2621 163 public static function getTableName() {
e501603b
TO
164 return self::$_tableName;
165 }
c3fc2621 166
e501603b
TO
167 /**
168 * Returns if this table needs to be logged
169 *
c3fc2621 170 * @return bool
e501603b 171 */
c3fc2621 172 public function getLog() {
e501603b
TO
173 return self::$_log;
174 }
c3fc2621 175
e501603b
TO
176 /**
177 * Returns the list of fields that can be imported
178 *
179 * @param bool $prefix
180 *
181 * @return array
182 */
c3fc2621
CW
183 public static function &import($prefix = FALSE) {
184 $r = CRM_Core_DAO_AllCoreTables::getImports(__CLASS__, 'mailing_event_trackable_url_open', $prefix, []);
60808919 185 return $r;
e501603b 186 }
c3fc2621 187
e501603b
TO
188 /**
189 * Returns the list of fields that can be exported
190 *
191 * @param bool $prefix
192 *
193 * @return array
194 */
c3fc2621
CW
195 public static function &export($prefix = FALSE) {
196 $r = CRM_Core_DAO_AllCoreTables::getExports(__CLASS__, 'mailing_event_trackable_url_open', $prefix, []);
60808919 197 return $r;
e501603b 198 }
c3fc2621 199
e7a6b91a
AS
200 /**
201 * Returns the list of indices
c3fc2621
CW
202 *
203 * @param bool $localize
204 *
205 * @return array
e7a6b91a
AS
206 */
207 public static function indices($localize = TRUE) {
c3fc2621 208 $indices = [];
e7a6b91a
AS
209 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables::multilingualize(__CLASS__, $indices) : $indices;
210 }
c3fc2621 211
e501603b 212}