diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/EntryController.php | 21 |
1 files changed, 10 insertions, 11 deletions
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 | |||
19 | */ | 19 | */ |
20 | public function addEntryAction(Request $request) | 20 | public function addEntryAction(Request $request) |
21 | { | 21 | { |
22 | $entry = new Entry(); | 22 | $entry = new Entry($this->getUser()); |
23 | $entry->setUserId(1); | ||
24 | 23 | ||
25 | $form = $this->createFormBuilder($entry) | 24 | $form = $this->createFormBuilder($entry) |
26 | ->add('url', 'url') | 25 | ->add('url', 'url') |
@@ -60,10 +59,10 @@ class EntryController extends Controller | |||
60 | */ | 59 | */ |
61 | public function showUnreadAction() | 60 | public function showUnreadAction() |
62 | { | 61 | { |
63 | $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry'); | ||
64 | // TODO don't give the user ID like this | ||
65 | // TODO change pagination | 62 | // TODO change pagination |
66 | $entries = $repository->findUnreadByUser(1, 0); | 63 | $entries = $this->getDoctrine() |
64 | ->getRepository('WallabagCoreBundle:Entry') | ||
65 | ->findUnreadByUser($this->getUser()->getId(), 0); | ||
67 | 66 | ||
68 | return $this->render( | 67 | return $this->render( |
69 | 'WallabagCoreBundle:Entry:entries.html.twig', | 68 | 'WallabagCoreBundle:Entry:entries.html.twig', |
@@ -79,10 +78,10 @@ class EntryController extends Controller | |||
79 | */ | 78 | */ |
80 | public function showArchiveAction() | 79 | public function showArchiveAction() |
81 | { | 80 | { |
82 | $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry'); | ||
83 | // TODO don't give the user ID like this | ||
84 | // TODO change pagination | 81 | // TODO change pagination |
85 | $entries = $repository->findArchiveByUser(1, 0); | 82 | $entries = $this->getDoctrine() |
83 | ->getRepository('WallabagCoreBundle:Entry') | ||
84 | ->findArchiveByUser($this->getUser()->getId(), 0); | ||
86 | 85 | ||
87 | return $this->render( | 86 | return $this->render( |
88 | 'WallabagCoreBundle:Entry:entries.html.twig', | 87 | 'WallabagCoreBundle:Entry:entries.html.twig', |
@@ -98,10 +97,10 @@ class EntryController extends Controller | |||
98 | */ | 97 | */ |
99 | public function showStarredAction() | 98 | public function showStarredAction() |
100 | { | 99 | { |
101 | $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry'); | ||
102 | // TODO don't give the user ID like this | ||
103 | // TODO change pagination | 100 | // TODO change pagination |
104 | $entries = $repository->findStarredByUser(1, 0); | 101 | $entries = $this->getDoctrine() |
102 | ->getRepository('WallabagCoreBundle:Entry') | ||
103 | ->findStarredByUser($this->getUser()->getId(), 0); | ||
105 | 104 | ||
106 | return $this->render( | 105 | return $this->render( |
107 | 'WallabagCoreBundle:Entry:entries.html.twig', | 106 | 'WallabagCoreBundle:Entry:entries.html.twig', |