PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / 5.0.3
Matomo Analytics – Powerful, Privacy-First Insights for WordPress v5.0.3
5.13.0 5.12.1 5.12.0 5.11.1 5.11.0 5.10.2 5.10.1 trunk 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.3.2 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.1.3 4.10.0 4.11.0 4.12.0 4.13.0 4.13.2 4.13.3 4.13.4 4.13.5 4.14.0 4.14.1 4.14.2 4.15.0 4.15.1 4.15.2 4.15.3 4.2.0 4.3.0 4.3.1 4.4.1 4.4.2 4.5.0 4.6.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.10.0 5.2.0 5.2.1 5.2.2 5.3.0 5.3.1 5.3.2 5.3.3 5.6.0 5.6.1 5.7.0 5.7.1 5.8.0 5.8.1 5.8.2
matomo / app / core / Tracker / LogTable.php
matomo / app / core / Tracker Last commit date
Db 2 years ago Handler 2 years ago Visit 2 years ago Action.php 2 years ago ActionPageview.php 2 years ago Cache.php 2 years ago Db.php 2 years ago Failures.php 2 years ago FingerprintSalt.php 2 years ago GoalManager.php 2 years ago Handler.php 2 years ago IgnoreCookie.php 2 years ago LogTable.php 2 years ago Model.php 2 years ago PageUrl.php 2 years ago Request.php 2 years ago RequestProcessor.php 2 years ago RequestSet.php 2 years ago Response.php 2 years ago ScheduledTasksRunner.php 2 years ago Settings.php 2 years ago TableLogAction.php 2 years ago TrackerCodeGenerator.php 2 years ago TrackerConfig.php 2 years ago Visit.php 2 years ago VisitExcluded.php 2 years ago VisitInterface.php 2 years ago Visitor.php 2 years ago VisitorNotFoundInDb.php 2 years ago VisitorRecognizer.php 2 years ago
LogTable.php
116 lines
1 <?php
2
3 /**
4 * Matomo - free/libre analytics platform
5 *
6 * @link https://matomo.org
7 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
8 *
9 */
10 namespace Piwik\Tracker;
11
12 /**
13 * Base class for LogTables. You need to create a log table eg if you want to be able to create a segment for a custom
14 * log table.
15 */
16 abstract class LogTable
17 {
18 /**
19 * Get the unprefixed database table name. For example 'log_visit' or 'log_action'.
20 * @return string
21 */
22 public abstract function getName();
23 /**
24 * Get the name of the column that represents the primary key. For example "idvisit" or "idlink_va". If the table
25 * does not have a unique ID for each row, you may choose a column that comes closest to it, for example "idvisit".
26 * @return string
27 */
28 public function getIdColumn()
29 {
30 return '';
31 }
32 /**
33 * Get the name of the column that can be used to join a visit with another table. This is the name of the column
34 * that represents the "idvisit".
35 * @return string
36 */
37 public function getColumnToJoinOnIdVisit()
38 {
39 return '';
40 }
41 /**
42 * Get the name of the column that can be used to join an action with another table. This is the name of the column
43 * that represents the "idaction".
44 *
45 * This could be more generic eg by specifying "$this->joinableOn = array('action' => 'idaction') and this
46 * would allow to also add more complex structures in the future but not needed for now I'd say. Let's go with
47 * simpler, more clean and expressive solution for now until needed.
48 *
49 * @return string
50 */
51 public function getColumnToJoinOnIdAction()
52 {
53 return '';
54 }
55 /**
56 * If a table can neither be joined via idVisit nor idAction, it should be given a way to join with other tables
57 * so the log table can be joined via idvisit through a different table joins.
58 *
59 * For this to work it requires the same column to be present in two tables. If for example you have a table
60 * `log_foo_bar (idlogfoobar, idlogfoo)` and a table `log_foo(idlogfoo, idsite, idvisit)`, then you can in the
61 * log table instance for `log_foo_bar` return `array('log_foo' => 'idlogfoo')`. This tells the core that a join
62 * with that other log table is possible using the specified column.
63 * @return array
64 */
65 public function getWaysToJoinToOtherLogTables()
66 {
67 return array();
68 }
69 /**
70 * Defines whether this table should be joined via a subselect. Return true if a complex join is needed. (eg when
71 * having visits and needing actions, or when having visits and needing conversions, or vice versa).
72 * @return bool
73 */
74 public function shouldJoinWithSubSelect()
75 {
76 return false;
77 }
78 /**
79 * Defines a column that stores the date/time at which time an entry was written or updated. Setting this
80 * can help improve the performance of some archive queries. For example the log_link_visit_action table would define
81 * server_time while log_visit would define visit_last_action_time
82 * @return string
83 */
84 public function getDateTimeColumn()
85 {
86 return '';
87 }
88 /**
89 * Returns the name of a log table that allows to join on a visit. Eg if there is a table "action", and it is not
90 * joinable with "visit" table, it can return "log_link_visit_action" to be able to join the action table on visit
91 * via this link table.
92 *
93 * In theory there could be case where it may be needed to join via two tables, so it could be needed at some
94 * point to return an array of tables here. not sure if we should handle this case just yet. Alternatively,
95 * once needed eg in LogQueryBuilder, we should maybe better call instead ->getLinkTableToBeAbleToJoinOnVisit()
96 * again on the returned table until we have found a table that can be joined with visit.
97 *
98 * @return string
99 */
100 public function getLinkTableToBeAbleToJoinOnVisit()
101 {
102 return;
103 }
104 /**
105 * Get the names of the columns that represents the primary key. For example "idvisit" or "idlink_va". If the table
106 * defines the primary key based on multiple columns, you must specify them all
107 * (eg array('idvisit', 'idgoal', 'buster')).
108 *
109 * @return array
110 */
111 public function getPrimaryKey()
112 {
113 return array();
114 }
115 }
116