5 * @copyright CiviCRM LLC https://civicrm.org/licensing
7 * Generated from xml/schema/CRM/Mailing/Event/TrackableURLOpen.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:a49c335dfa1bde412a6123d715c9ef34)
13 * Database access object for the TrackableURLOpen entity.
15 class CRM_Mailing_Event_DAO_TrackableURLOpen
extends CRM_Core_DAO
{
16 const EXT
= 'civicrm';
17 const TABLE_ADDED
= '';
18 const COMPONENT
= 'CiviMail';
21 * Static instance to hold the table name.
25 public static $_tableName = 'civicrm_mailing_event_trackable_url_open';
28 * Should CiviCRM log any modifications to this table in the civicrm_log table.
32 public static $_log = FALSE;
35 * @var int|string|null
36 * (SQL type: int unsigned)
37 * Note that values will be retrieved from the database as a string.
45 * (SQL type: int unsigned)
46 * Note that values will be retrieved from the database as a string.
48 public $event_queue_id;
54 * (SQL type: int unsigned)
55 * Note that values will be retrieved from the database as a string.
57 public $trackable_url_id;
60 * When this trackable URL open occurred.
63 * (SQL type: timestamp)
64 * Note that values will be retrieved from the database as a string.
71 public function __construct() {
72 $this->__table
= 'civicrm_mailing_event_trackable_url_open';
73 parent
::__construct();
77 * Returns localized title of this entity.
80 * Whether to return the plural version of the title.
82 public static function getEntityTitle($plural = FALSE) {
83 return $plural ?
ts('Trackable URLOpens') : ts('Trackable URLOpen');
87 * Returns foreign keys and entity references.
90 * [CRM_Core_Reference_Interface]
92 public static function getReferenceColumns() {
93 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
94 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
95 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id');
96 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'trackable_url_id', 'civicrm_mailing_trackable_url', 'id');
97 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
99 return Civi
::$statics[__CLASS__
]['links'];
103 * Returns all the column names of this table
107 public static function &fields() {
108 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
109 Civi
::$statics[__CLASS__
]['fields'] = [
112 'type' => CRM_Utils_Type
::T_INT
,
113 'title' => ts('Trackable URL Open ID'),
115 'where' => 'civicrm_mailing_event_trackable_url_open.id',
116 'table_name' => 'civicrm_mailing_event_trackable_url_open',
117 'entity' => 'TrackableURLOpen',
118 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
126 'event_queue_id' => [
127 'name' => 'event_queue_id',
128 'type' => CRM_Utils_Type
::T_INT
,
129 'title' => ts('Event Queue ID'),
130 'description' => ts('FK to EventQueue'),
132 'where' => 'civicrm_mailing_event_trackable_url_open.event_queue_id',
133 'table_name' => 'civicrm_mailing_event_trackable_url_open',
134 'entity' => 'TrackableURLOpen',
135 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
137 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
139 'label' => ts("Event Queue"),
143 'trackable_url_id' => [
144 'name' => 'trackable_url_id',
145 'type' => CRM_Utils_Type
::T_INT
,
146 'title' => ts('Trackable Url ID'),
147 'description' => ts('FK to TrackableURL'),
149 'where' => 'civicrm_mailing_event_trackable_url_open.trackable_url_id',
150 'table_name' => 'civicrm_mailing_event_trackable_url_open',
151 'entity' => 'TrackableURLOpen',
152 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
154 'FKClassName' => 'CRM_Mailing_DAO_TrackableURL',
156 'label' => ts("Trackable Url"),
161 'name' => 'time_stamp',
162 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
163 'title' => ts('Timestamp'),
164 'description' => ts('When this trackable URL open occurred.'),
166 'where' => 'civicrm_mailing_event_trackable_url_open.time_stamp',
167 'default' => 'CURRENT_TIMESTAMP',
168 'table_name' => 'civicrm_mailing_event_trackable_url_open',
169 'entity' => 'TrackableURLOpen',
170 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
175 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
177 return Civi
::$statics[__CLASS__
]['fields'];
181 * Return a mapping from field-name to the corresponding key (as used in fields()).
184 * Array(string $name => string $uniqueName).
186 public static function &fieldKeys() {
187 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
188 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
190 return Civi
::$statics[__CLASS__
]['fieldKeys'];
194 * Returns the names of this table
198 public static function getTableName() {
199 return self
::$_tableName;
203 * Returns if this table needs to be logged
207 public function getLog() {
212 * Returns the list of fields that can be imported
214 * @param bool $prefix
218 public static function &import($prefix = FALSE) {
219 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_trackable_url_open', $prefix, []);
224 * Returns the list of fields that can be exported
226 * @param bool $prefix
230 public static function &export($prefix = FALSE) {
231 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_trackable_url_open', $prefix, []);
236 * Returns the list of indices
238 * @param bool $localize
242 public static function indices($localize = TRUE) {
244 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;