3 namespace Wallabag\CoreBundle\Controller
;
5 use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route
;
6 use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter
;
7 use Symfony\Bundle\FrameworkBundle\Controller\Controller
;
8 use Wallabag\CoreBundle\Entity\User
;
9 use Wallabag\CoreBundle\Entity\Entry
;
11 class RssController
extends Controller
14 * Shows unread entries for current user.
16 * @Route("/{username}/{token}/unread.xml", name="unread_rss", defaults={"_format"="xml"})
17 * @ParamConverter("user", class="WallabagCoreBundle:User", converter="username_rsstoken_converter")
19 * @return \Symfony\Component\HttpFoundation\Response
21 public function showUnreadAction(User
$user)
23 $entries = $this->getDoctrine()
24 ->getRepository('WallabagCoreBundle:Entry')
28 $user->getConfig()->getRssLimit() ?: $this->container
->getParameter('rss_limit')
31 return $this->render('WallabagCoreBundle:Entry:entries.xml.twig', array(
33 'entries' => $entries,
38 * Shows read entries for current user.
40 * @Route("/{username}/{token}/archive.xml", name="archive_rss")
41 * @ParamConverter("user", class="WallabagCoreBundle:User", converter="username_rsstoken_converter")
43 * @return \Symfony\Component\HttpFoundation\Response
45 public function showArchiveAction(User
$user)
47 $entries = $this->getDoctrine()
48 ->getRepository('WallabagCoreBundle:Entry')
52 $user->getConfig()->getRssLimit() ?: $this->container
->getParameter('rss_limit')
55 return $this->render('WallabagCoreBundle:Entry:entries.xml.twig', array(
57 'entries' => $entries,
62 * Shows starred entries for current user.
64 * @Route("/{username}/{token}/starred.xml", name="starred_rss")
65 * @ParamConverter("user", class="WallabagCoreBundle:User", converter="username_rsstoken_converter")
67 * @return \Symfony\Component\HttpFoundation\Response
69 public function showStarredAction(User
$user)
71 $entries = $this->getDoctrine()
72 ->getRepository('WallabagCoreBundle:Entry')
76 $user->getConfig()->getRssLimit() ?: $this->container
->getParameter('rss_limit')
79 return $this->render('WallabagCoreBundle:Entry:entries.xml.twig', array(
81 'entries' => $entries,