/** * @param Cruncher $cruncher * @param Node $node * @param string $locale * @param string $cacheKey * @param array $compilation * @return array */ protected function compileTableLocaleStatistics(Cruncher $cruncher, Node $node, $locale, $cacheKey, array $compilation) { list($last_year_stats, $last_year_labels) = $cruncher->getCountPerMonth(Carbon::today()->subYear(), null, $locale, $node->trackerViews(), $cacheKey); $compilation = $this->compileYearStatistics($last_year_stats, $last_year_labels, $compilation, $locale); list($last_month_stats, $last_month_labels) = $cruncher->getCountPerWeek(Carbon::today()->subMonth(), null, $locale, $node->trackerViews(), $cacheKey); $compilation = $this->compileMonthStatistics($last_month_stats, $last_month_labels, $compilation, $locale); list($last_week_stats, $last_week_labels) = $cruncher->getCountPerDay(Carbon::today()->subWeek(), null, $locale, $node->trackerViews(), $cacheKey); $compilation = $this->compileWeekStatistics($last_week_stats, $last_week_labels, $compilation, $locale); return $compilation; }