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

CustomDimension.php « CustomVariables « plugins - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cd899503cf3dffa2cb8e517ba58414c724d67d13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
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();
    }

}