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:6e1eb0a358ed16c691ea25a741ce6f8c)
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
= '';
20 * Static instance to hold the table name.
24 public static $_tableName = 'civicrm_mailing_event_trackable_url_open';
27 * Should CiviCRM log any modifications to this table in the civicrm_log table.
31 public static $_log = FALSE;
43 public $event_queue_id;
50 public $trackable_url_id;
53 * When this trackable URL open occurred.
62 public function __construct() {
63 $this->__table
= 'civicrm_mailing_event_trackable_url_open';
64 parent
::__construct();
68 * Returns localized title of this entity.
71 * Whether to return the plural version of the title.
73 public static function getEntityTitle($plural = FALSE) {
74 return $plural ?
ts('Trackable URLOpens') : ts('Trackable URLOpen');
78 * Returns foreign keys and entity references.
81 * [CRM_Core_Reference_Interface]
83 public static function getReferenceColumns() {
84 if (!isset(Civi
::$statics[__CLASS__
]['links'])) {
85 Civi
::$statics[__CLASS__
]['links'] = static::createReferenceColumns(__CLASS__
);
86 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'event_queue_id', 'civicrm_mailing_event_queue', 'id');
87 Civi
::$statics[__CLASS__
]['links'][] = new CRM_Core_Reference_Basic(self
::getTableName(), 'trackable_url_id', 'civicrm_mailing_trackable_url', 'id');
88 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'links_callback', Civi
::$statics[__CLASS__
]['links']);
90 return Civi
::$statics[__CLASS__
]['links'];
94 * Returns all the column names of this table
98 public static function &fields() {
99 if (!isset(Civi
::$statics[__CLASS__
]['fields'])) {
100 Civi
::$statics[__CLASS__
]['fields'] = [
103 'type' => CRM_Utils_Type
::T_INT
,
104 'title' => ts('Trackable URL Open ID'),
106 'where' => 'civicrm_mailing_event_trackable_url_open.id',
107 'table_name' => 'civicrm_mailing_event_trackable_url_open',
108 'entity' => 'TrackableURLOpen',
109 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
113 'event_queue_id' => [
114 'name' => 'event_queue_id',
115 'type' => CRM_Utils_Type
::T_INT
,
116 'title' => ts('Event Queue'),
117 'description' => ts('FK to EventQueue'),
119 'where' => 'civicrm_mailing_event_trackable_url_open.event_queue_id',
120 'table_name' => 'civicrm_mailing_event_trackable_url_open',
121 'entity' => 'TrackableURLOpen',
122 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
124 'FKClassName' => 'CRM_Mailing_Event_DAO_Queue',
127 'trackable_url_id' => [
128 'name' => 'trackable_url_id',
129 'type' => CRM_Utils_Type
::T_INT
,
130 'title' => ts('Trackable Url'),
131 'description' => ts('FK to TrackableURL'),
133 'where' => 'civicrm_mailing_event_trackable_url_open.trackable_url_id',
134 'table_name' => 'civicrm_mailing_event_trackable_url_open',
135 'entity' => 'TrackableURLOpen',
136 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
138 'FKClassName' => 'CRM_Mailing_DAO_TrackableURL',
142 'name' => 'time_stamp',
143 'type' => CRM_Utils_Type
::T_TIMESTAMP
,
144 'title' => ts('Timestamp'),
145 'description' => ts('When this trackable URL open occurred.'),
147 'where' => 'civicrm_mailing_event_trackable_url_open.time_stamp',
148 'default' => 'CURRENT_TIMESTAMP',
149 'table_name' => 'civicrm_mailing_event_trackable_url_open',
150 'entity' => 'TrackableURLOpen',
151 'bao' => 'CRM_Mailing_Event_BAO_TrackableURLOpen',
156 CRM_Core_DAO_AllCoreTables
::invoke(__CLASS__
, 'fields_callback', Civi
::$statics[__CLASS__
]['fields']);
158 return Civi
::$statics[__CLASS__
]['fields'];
162 * Return a mapping from field-name to the corresponding key (as used in fields()).
165 * Array(string $name => string $uniqueName).
167 public static function &fieldKeys() {
168 if (!isset(Civi
::$statics[__CLASS__
]['fieldKeys'])) {
169 Civi
::$statics[__CLASS__
]['fieldKeys'] = array_flip(CRM_Utils_Array
::collect('name', self
::fields()));
171 return Civi
::$statics[__CLASS__
]['fieldKeys'];
175 * Returns the names of this table
179 public static function getTableName() {
180 return self
::$_tableName;
184 * Returns if this table needs to be logged
188 public function getLog() {
193 * Returns the list of fields that can be imported
195 * @param bool $prefix
199 public static function &import($prefix = FALSE) {
200 $r = CRM_Core_DAO_AllCoreTables
::getImports(__CLASS__
, 'mailing_event_trackable_url_open', $prefix, []);
205 * Returns the list of fields that can be exported
207 * @param bool $prefix
211 public static function &export($prefix = FALSE) {
212 $r = CRM_Core_DAO_AllCoreTables
::getExports(__CLASS__
, 'mailing_event_trackable_url_open', $prefix, []);
217 * Returns the list of indices
219 * @param bool $localize
223 public static function indices($localize = TRUE) {
225 return ($localize && !empty($indices)) ? CRM_Core_DAO_AllCoreTables
::multilingualize(__CLASS__
, $indices) : $indices;