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:b72c3391aec97b4f66c2004364f597b3)
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;
44 public $event_queue_id;
51 public $trackable_url_id;
54 * When this trackable URL open occurred.
63 public function __construct() {
64 $this->__table
= 'civicrm_mailing_event_trackable_url_open';
65 parent
::__construct();
69 * Returns localized title of this entity.
72 * Whether to return the plural version of the title.
74 public static function getEntityTitle($plural = FALSE) {
75 return $plural ?
ts('Trackable URLOpens') : ts('Trackable URLOpen');
79 * Returns foreign keys and entity references.
82 * [CRM_Core_Reference_Interface]
84 public static function getReferenceColumns() {
85 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
86 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
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');
89 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
91 return Civi
::$statics[__CLASS__
]['links'];
95 * Returns all the column names of this table
99 public static function &fields() {
100 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
101 Civi
::$statics[__CLASS__
]['fields'] = [
104 'type' => CRM_Utils_Type
::T_INT
,
105 'title' => ts('Trackable URL Open ID'),
107 'where' => 'civicrm_mailing_event_trackable_url_open.id',
108 'table_name' => 'civicrm_mailing_event_trackable_url_open',
109 'entity' => 'TrackableURLOpen',
110 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
114 'event_queue_id' => [
115 'name' => 'event_queue_id',
116 'type' => CRM_Utils_Type
::T_INT
,
117 'title' => ts('Event Queue'),
118 'description' => ts('FK to EventQueue'),
120 'where' => 'civicrm_mailing_event_trackable_url_open.event_queue_id',
121 'table_name' => 'civicrm_mailing_event_trackable_url_open',
122 'entity' => 'TrackableURLOpen',
123 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
125 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
128 'trackable_url_id' => [
129 'name' => 'trackable_url_id',
130 'type' => CRM_Utils_Type
::T_INT
,
131 'title' => ts('Trackable Url'),
132 'description' => ts('FK to TrackableURL'),
134 'where' => 'civicrm_mailing_event_trackable_url_open.trackable_url_id',
135 'table_name' => 'civicrm_mailing_event_trackable_url_open',
136 'entity' => 'TrackableURLOpen',
137 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
139 'FKClassName' => 'CRM_Mailing_DAO_TrackableURL',
143 'name' => 'time_stamp',
144 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
145 'title' => ts('Timestamp'),
146 'description' => ts('When this trackable URL open occurred.'),
148 'where' => 'civicrm_mailing_event_trackable_url_open.time_stamp',
149 'default' => 'CURRENT_TIMESTAMP',
150 'table_name' => 'civicrm_mailing_event_trackable_url_open',
151 'entity' => 'TrackableURLOpen',
152 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
157 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
159 return Civi
::$statics[__CLASS__
]['fields'];
163 * Return a mapping from field-name to the corresponding key (as used in fields()).
166 * Array(string $name => string $uniqueName).
168 public static function &fieldKeys() {
169 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
170 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
172 return Civi
::$statics[__CLASS__
]['fieldKeys'];
176 * Returns the names of this table
180 public static function getTableName() {
181 return self
::$_tableName;
185 * Returns if this table needs to be logged
189 public function getLog() {
194 * Returns the list of fields that can be imported
196 * @param bool $prefix
200 public static function &import($prefix = FALSE) {
201 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_trackable_url_open', $prefix, []);
206 * Returns the list of fields that can be exported
208 * @param bool $prefix
212 public static function &export($prefix = FALSE) {
213 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_trackable_url_open', $prefix, []);
218 * Returns the list of indices
220 * @param bool $localize
224 public static function indices($localize = TRUE) {
226 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;