Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/Actions/Columns/TimeSpentRefAction.php')
-rw-r--r--plugins/Actions/Columns/TimeSpentRefAction.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/plugins/Actions/Columns/TimeSpentRefAction.php b/plugins/Actions/Columns/TimeSpentRefAction.php
new file mode 100644
index 0000000000..44a1094348
--- /dev/null
+++ b/plugins/Actions/Columns/TimeSpentRefAction.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Piwik - Open source web analytics
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\Actions\Columns;
+
+use Piwik\Plugin\ActionDimension;
+use Piwik\Tracker\Action;
+use Piwik\Tracker\Request;
+use Piwik\Tracker;
+
+class TimeSpentRefAction extends ActionDimension
+{
+ protected $fieldName = 'time_spent_ref_action';
+ protected $fieldType = 'INTEGER(10) UNSIGNED NOT NULL';
+
+ public function getName()
+ {
+ return '';
+ }
+
+ public function onNewAction(Request $request, Action $action, Tracker\Visitor $visitor)
+ {
+ $timeSpent = $visitor->getVisitorColumn('time_spent_ref_action');
+
+ if (empty($timeSpent)) {
+ return 0;
+ }
+
+ return $timeSpent;
+ }
+}