diff options
Diffstat (limited to 'plugins/Events/Columns/EventCategory.php')
-rw-r--r-- | plugins/Events/Columns/EventCategory.php | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/plugins/Events/Columns/EventCategory.php b/plugins/Events/Columns/EventCategory.php index 731dd9615c..b10b1a8406 100644 --- a/plugins/Events/Columns/EventCategory.php +++ b/plugins/Events/Columns/EventCategory.php @@ -8,10 +8,10 @@ */ namespace Piwik\Plugins\Events\Columns; +use Piwik\Columns\Discriminator; +use Piwik\Columns\Join\ActionNameJoin; use Piwik\Exception\InvalidRequestParameterException; -use Piwik\Piwik; use Piwik\Plugin\Dimension\ActionDimension; -use Piwik\Plugins\Events\Segment; use Piwik\Plugins\Events\Actions\ActionEvent; use Piwik\Tracker\Action; use Piwik\Tracker\Request; @@ -20,18 +20,21 @@ class EventCategory extends ActionDimension { protected $columnName = 'idaction_event_category'; protected $columnType = 'INTEGER(10) UNSIGNED DEFAULT NULL'; - - protected function configureSegments() + protected $type = self::TYPE_TEXT; + protected $category = 'Events_Events'; + protected $sqlFilter = '\Piwik\Tracker\TableLogAction::getIdActionFromSegment'; + protected $segmentName = 'eventCategory'; + protected $nameSingular = 'Events_EventCategory'; + protected $namePlural = 'Events_EventCategories'; + + public function getDbColumnJoin() { - $segment = new Segment(); - $segment->setSegment('eventCategory'); - $segment->setName('Events_EventCategory'); - $this->addSegment($segment); + return new ActionNameJoin(); } - public function getName() + public function getDbDiscriminator() { - return Piwik::translate('Events_EventCategory'); + return new Discriminator('log_action', 'type', $this->getActionId()); } public function getActionId() |