/** * Fetches page views data for a given set of articles. The data includes * number of views for the last four time ids (data points). * * @param $articlesIds An array of IDs of articles to fetch views for * @return array An array with views for the last four time ids */ public function getPageViewsData($articlesIds) { global $wgCityId; /** * Get pv for the last 4 Sundays */ $pvTimes = InsightsHelper::getLastFourTimeIds(); $pvData = []; foreach ($pvTimes as $timeId) { $pvData[] = DataMartService::getPageViewsForArticles($articlesIds, $timeId, $wgCityId); } return $pvData; }