public function feedAction(Request $request, Blog $blog)
    {
        $articles = $blog->getPublishedArticles();
        if ($categoryId = $request->query->get('category')) {
            $entityManager = $this->getDoctrine()->getManager();
            /** @var Category $category */
            $category = $entityManager->getRepository('VictoireBlogBundle:BlogCategory')->find($categoryId);
            $categoryIds = [];

            function findIds(BlogCategory $category, &$categoryIds)
            {
                $categoryIds[] = $category->getId();

                foreach ($category->getChildren() as $childCategory) {
                    findIds($childCategory, $categoryIds);
                }
            }

            findIds($category, $categoryIds);

            $articles = $articles->filter(function ($article) use ($categoryIds) {
                /* @var Article $article */
                return $article->getCategory() && in_array($article->getCategory()->getId(), $categoryIds, true);
            });
        }

        return $this->render('VictoireBlogBundle:Blog:feed.rss.twig', [
            'blog'     => $blog,
            'articles' => $articles,
        ]);
    }