public function getMoversAndShakers($idSite, $period, $date, $reportUniqueId, $segment = false, $comparedToXPeriods = 1, $limitIncreaser = 4, $limitDecreaser = 4)
{
Piwik::checkUserHasViewAccess(array($idSite));
$metric = 'nb_visits';
$orderBy = InsightReport::ORDER_BY_ABSOLUTE;
$reportMetadata = $this->model->getReportByUniqueId($idSite, $reportUniqueId);
if (empty($reportMetadata)) {
throw new \Exception('A report having the ID ' . $reportUniqueId . ' does not exist');
}
$totalValue = $this->model->getTotalValue($idSite, $period, $date, $metric, $segment);
$currentReport = $this->model->requestReport($idSite, $period, $date, $reportUniqueId, $metric, $segment);
$this->checkReportIsValid($currentReport);
$lastDate = $this->model->getLastDate($date, $period, $comparedToXPeriods);
$lastTotalValue = $this->model->getTotalValue($idSite, $period, $lastDate, $metric, $segment);
$lastReport = $this->model->requestReport($idSite, $period, $lastDate, $reportUniqueId, $metric, $segment);
$this->checkReportIsValid($lastReport);
$insight = new InsightReport();
return $insight->generateMoverAndShaker($reportMetadata, $period, $date, $lastDate, $metric, $currentReport, $lastReport, $totalValue, $lastTotalValue, $orderBy, $limitIncreaser, $limitDecreaser);
}