5 * @copyright CiviCRM LLC (c) 2004-2020
7 * Generated from xml/schema/CRM/Mailing/Event/TrackableURLOpen.xml
8 * DO NOT EDIT. Generated by CRM_Core_CodeGen
9 * (GenCodeChecksum:eb4907c60fad19559fe6dcc069445590)
13 * Database access object for the TrackableURLOpen entity.
15 class CRM_Mailing_Event_DAO_TrackableURLOpen
extends CRM_Core_DAO
{
18 * Static instance to hold the table name.
22 public static $_tableName = 'civicrm_mailing_event_trackable_url_open';
25 * Should CiviCRM log any modifications to this table in the civicrm_log table.
29 public static $_log = FALSE;
41 public $event_queue_id;
48 public $trackable_url_id;
51 * When this trackable URL open occurred.
60 public function __construct() {
61 $this->__table
= 'civicrm_mailing_event_trackable_url_open';
62 parent
::__construct();
66 * Returns foreign keys and entity references.
69 * [CRM_Core_Reference_Interface]
71 public static function getReferenceColumns() {
72 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
73 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
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');
76 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
78 return Civi
::$statics[__CLASS__
]['links'];
82 * Returns all the column names of this table
86 public static function &fields() {
87 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
88 Civi
::$statics[__CLASS__
]['fields'] = [
91 'type' => CRM_Utils_Type
::T_INT
,
92 'title' => ts('Trackable URL Open ID'),
94 'where' => 'civicrm_mailing_event_trackable_url_open.id',
95 'table_name' => 'civicrm_mailing_event_trackable_url_open',
96 'entity' => 'TrackableURLOpen',
97 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
100 'event_queue_id' => [
101 'name' => 'event_queue_id',
102 'type' => CRM_Utils_Type
::T_INT
,
103 'title' => ts('Event Queue'),
104 'description' => ts('FK to EventQueue'),
106 'where' => 'civicrm_mailing_event_trackable_url_open.event_queue_id',
107 'table_name' => 'civicrm_mailing_event_trackable_url_open',
108 'entity' => 'TrackableURLOpen',
109 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
111 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
113 'trackable_url_id' => [
114 'name' => 'trackable_url_id',
115 'type' => CRM_Utils_Type
::T_INT
,
116 'title' => ts('Trackable Url'),
117 'description' => ts('FK to TrackableURL'),
119 'where' => 'civicrm_mailing_event_trackable_url_open.trackable_url_id',
120 'table_name' => 'civicrm_mailing_event_trackable_url_open',
121 'entity' => 'TrackableURLOpen',
122 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
124 'FKClassName' => 'CRM_Mailing_DAO_TrackableURL',
127 'name' => 'time_stamp',
128 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
129 'title' => ts('Timestamp'),
130 'description' => ts('When this trackable URL open occurred.'),
132 'where' => 'civicrm_mailing_event_trackable_url_open.time_stamp',
133 'default' => 'CURRENT_TIMESTAMP',
134 'table_name' => 'civicrm_mailing_event_trackable_url_open',
135 'entity' => 'TrackableURLOpen',
136 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
140 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
142 return Civi
::$statics[__CLASS__
]['fields'];
146 * Return a mapping from field-name to the corresponding key (as used in fields()).
149 * Array(string $name => string $uniqueName).
151 public static function &fieldKeys() {
152 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
153 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
155 return Civi
::$statics[__CLASS__
]['fieldKeys'];
159 * Returns the names of this table
163 public static function getTableName() {
164 return self
::$_tableName;
168 * Returns if this table needs to be logged
172 public function getLog() {
177 * Returns the list of fields that can be imported
179 * @param bool $prefix
183 public static function &import($prefix = FALSE) {
184 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_trackable_url_open', $prefix, []);
189 * Returns the list of fields that can be exported
191 * @param bool $prefix
195 public static function &export($prefix = FALSE) {
196 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_trackable_url_open', $prefix, []);
201 * Returns the list of indices
203 * @param bool $localize
207 public static function indices($localize = TRUE) {
209 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;