public function getArchives($blog)
    {
        $postDatas = $this->repo->findArchiveDatasByBlog($blog);
        $archiveDatas = [];

        foreach ($postDatas as $postData) {
            $year = $postData['year'];
            $month = $postData['month'];
            $count = $postData['count'];

            $archiveDatas[$year][] = [
                'month' => $this->translator->trans('month.'.date('F', mktime(0, 0, 0, $month, 10)), [], 'platform'),
                'monthValue' => $month,
                'count' => $count,
            ];
        }

        return $archiveDatas;
    }
public function getArchives($blog)
    {
        $postDatas = $this->repo->findArchiveDatasByBlog($blog);
        $archiveDatas = [];

        foreach ($postDatas as $postData) {
            $year = $postData['year'];
            $month = $postData['month'];
            $count = $postData['count'];

            $archiveDatas[$year][] = [
                'month' => $this->translator->trans('month.'.date('F', mktime(0, 0, 0, $month, 10)), [], 'platform'),
                'monthValue' => $month,
                'count' => $count,
            ];
        }

        return $archiveDatas;
    }
public function getArchives ( $ blog ) { $ postDatas = $ this -> repo -> findArchiveDatasByBlog ( $ blog ) ; $ archiveDatas = [ ] ; foreach ( $ postDatas as $ postData ) { $ year = $ postData [ 'year' ] ; $ month = $ postData [ 'month' ] ; $ count = $ postData [ 'count' ] ; $ archiveDatas [ $ year ] [ ] = [ 'month' => $ this -> translator -> trans ( 'month.' . date ( 'F' , mktime ( 0 , 0 , 0 , $ month , 10 ) ) , [ ] , 'platform' ) , 'monthValue' => $ month , 'count' => $ count , ] ; } return $ archiveDatas ; }
Get blog posts archives.

@param Blog $blog

@return array
Get blog posts archives .