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/CustomVariables/CustomDimension.php')
-rw-r--r--plugins/CustomVariables/CustomDimension.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/plugins/CustomVariables/CustomDimension.php b/plugins/CustomVariables/CustomDimension.php
new file mode 100644
index 0000000000..cd899503cf
--- /dev/null
+++ b/plugins/CustomVariables/CustomDimension.php
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Piwik - free/libre analytics platform
+ *
+ * @link http://piwik.org
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
+ *
+ */
+namespace Piwik\Plugins\CustomVariables;
+
+use Piwik\Columns\Dimension;
+use Piwik\Piwik;
+
+class CustomDimension extends Dimension
+{
+ protected $type = self::TYPE_TEXT;
+
+ private $id;
+
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ public function initCustomDimension($index, Model $scope)
+ {
+ $category = $scope->getScopeDescription();
+
+ $this->id = 'CustomVariables.CustomVariable' . ucfirst($scope->getScope()) . $index;
+ $this->nameSingular = Piwik::translate('CustomVariables_ColumnCustomVariableValue') . ' ' . $index . ' (' . $category .')';
+ $this->columnName = 'custom_var_v' . (int) $index;
+ $this->category = 'CustomVariables_CustomVariables';
+ $this->dbTableName = $scope->getUnprefixedTableName();
+ }
+
+} \ No newline at end of file