X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FController%2FEntryController.php;h=e0697ca3ef3852af631eef32eb91813b8b7acdab;hb=cbce162b407024882d8c37a7e3298c85175d2651;hp=6326d31fc5b2f4d2073cf71430e320b1b5e55716;hpb=29c4517f7a8ed08239e5bee3d6c3fa823a83d102;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 6326d31f..e0697ca3 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -19,8 +19,7 @@ class EntryController extends Controller */ public function addEntryAction(Request $request) { - $entry = new Entry(); - $entry->setUserId(1); + $entry = new Entry($this->getUser()); $form = $this->createFormBuilder($entry) ->add('url', 'url') @@ -60,10 +59,10 @@ class EntryController extends Controller */ public function showUnreadAction() { - $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry'); - // TODO don't give the user ID like this // TODO change pagination - $entries = $repository->findUnreadByUser(1, 0); + $entries = $this->getDoctrine() + ->getRepository('WallabagCoreBundle:Entry') + ->findUnreadByUser($this->getUser()->getId(), 0); return $this->render( 'WallabagCoreBundle:Entry:entries.html.twig', @@ -79,10 +78,10 @@ class EntryController extends Controller */ public function showArchiveAction() { - $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry'); - // TODO don't give the user ID like this // TODO change pagination - $entries = $repository->findArchiveByUser(1, 0); + $entries = $this->getDoctrine() + ->getRepository('WallabagCoreBundle:Entry') + ->findArchiveByUser($this->getUser()->getId(), 0); return $this->render( 'WallabagCoreBundle:Entry:entries.html.twig', @@ -98,10 +97,10 @@ class EntryController extends Controller */ public function showStarredAction() { - $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry'); - // TODO don't give the user ID like this // TODO change pagination - $entries = $repository->findStarredByUser(1, 0); + $entries = $this->getDoctrine() + ->getRepository('WallabagCoreBundle:Entry') + ->findStarredByUser($this->getUser()->getId(), 0); return $this->render( 'WallabagCoreBundle:Entry:entries.html.twig',