diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2018-12-28 01:39:09 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-28 01:39:09 +0300 |
commit | a9d7363bb247ac00dd10cbfcf8d93bf25ba1a45a (patch) | |
tree | 41de77270e2f484aeadbdd4afd38ff4fd04d32e3 /plugins/Live | |
parent | e8447f5c66fcc49bebfc21ada703f143633fec0a (diff) |
Use Request::processRequest instead of API instance directly. (#13911)
Diffstat (limited to 'plugins/Live')
-rw-r--r-- | plugins/Live/Controller.php | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/Live/Controller.php b/plugins/Live/Controller.php index c8978cef18..e8556fe215 100644 --- a/plugins/Live/Controller.php +++ b/plugins/Live/Controller.php @@ -97,9 +97,19 @@ class Controller extends \Piwik\Plugin\Controller private function setCounters($view) { $segment = Request::getRawSegmentFromRequest(); - $last30min = API::getInstance()->getCounters($this->idSite, $lastMinutes = 30, $segment, array('visits', 'actions')); + $last30min = Request::processRequest('Live.getCounters', [ + 'idSite' => $this->idSite, + 'lastMinutes' => 30, + 'segment' => $segment, + 'showColumns' => 'visits,actions', + ], $default = []); $last30min = $last30min[0]; - $today = API::getInstance()->getCounters($this->idSite, $lastMinutes = 24 * 60, $segment, array('visits', 'actions')); + $today = Request::processRequest('Live.getCounters', [ + 'idSite' => $this->idSite, + 'lastMinutes' => 24 * 60, + 'segment' => $segment, + 'showColumns' => 'visits,actions', + ], $default = []); $today = $today[0]; $view->visitorsCountHalfHour = $last30min['visits']; $view->visitorsCountToday = $today['visits']; |