1<?php 2/** 3 * Matomo - free/libre analytics platform 4 * 5 * @link https://matomo.org 6 * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later 7 * 8 */ 9namespace Piwik\Plugins\Goals; 10 11use Piwik\Columns\Dimension; 12use Piwik\Columns\Discriminator; 13 14class GoalDimension extends Dimension 15{ 16 protected $type = self::TYPE_TEXT; 17 private $goal; 18 private $id; 19 20 public function __construct($goal, $column, $name) 21 { 22 $this->goal = $goal; 23 $this->category = 'Goals_Goals'; 24 $this->dbTableName = 'log_conversion'; 25 $this->columnName = $column; 26 $this->nameSingular = $name; 27 28 $this->id = 'Goals.Goal' . ucfirst($column) . $goal['idgoal']; 29 } 30 31 public function getId() 32 { 33 return $this->id; 34 } 35 36 public function getDbDiscriminator() 37 { 38 return new Discriminator('log_conversion', 'idgoal', $this->goal['idgoal']); 39 } 40 41}