diff options
author | Jeremy <jeremy.benoist@gmail.com> | 2015-02-08 23:05:51 +0100 |
---|---|---|
committer | Jeremy <jeremy.benoist@gmail.com> | 2015-02-08 23:13:40 +0100 |
commit | 3b815d2de5a852fe2ebad5827bd4c9070aa175ea (patch) | |
tree | 504e54ecfd8ae6203f76a19a910e5e6c5dee1c3e /src/Wallabag/CoreBundle/Controller | |
parent | d91691573f108422cc2080462af35ebd62dc93fb (diff) | |
download | wallabag-3b815d2de5a852fe2ebad5827bd4c9070aa175ea.tar.gz wallabag-3b815d2de5a852fe2ebad5827bd4c9070aa175ea.tar.zst wallabag-3b815d2de5a852fe2ebad5827bd4c9070aa175ea.zip |
Add some fixtures
Improve test, so user can login
Fix some leftJoin
Cleanup EntryController
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller')
-rw-r--r-- | src/Wallabag/CoreBundle/Controller/EntryController.php | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 2dfe2f51..e0697ca3 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php | |||
@@ -19,9 +19,7 @@ class EntryController extends Controller | |||
19 | */ | 19 | */ |
20 | public function addEntryAction(Request $request) | 20 | public function addEntryAction(Request $request) |
21 | { | 21 | { |
22 | $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:User'); | 22 | $entry = new Entry($this->getUser()); |
23 | $user = $repository->find(1); | ||
24 | $entry = new Entry($user); | ||
25 | 23 | ||
26 | $form = $this->createFormBuilder($entry) | 24 | $form = $this->createFormBuilder($entry) |
27 | ->add('url', 'url') | 25 | ->add('url', 'url') |
@@ -61,10 +59,10 @@ class EntryController extends Controller | |||
61 | */ | 59 | */ |
62 | public function showUnreadAction() | 60 | public function showUnreadAction() |
63 | { | 61 | { |
64 | $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry'); | ||
65 | // TODO don't give the user ID like this | ||
66 | // TODO change pagination | 62 | // TODO change pagination |
67 | $entries = $repository->findUnreadByUser(1, 0); | 63 | $entries = $this->getDoctrine() |
64 | ->getRepository('WallabagCoreBundle:Entry') | ||
65 | ->findUnreadByUser($this->getUser()->getId(), 0); | ||
68 | 66 | ||
69 | return $this->render( | 67 | return $this->render( |
70 | 'WallabagCoreBundle:Entry:entries.html.twig', | 68 | 'WallabagCoreBundle:Entry:entries.html.twig', |
@@ -80,10 +78,10 @@ class EntryController extends Controller | |||
80 | */ | 78 | */ |
81 | public function showArchiveAction() | 79 | public function showArchiveAction() |
82 | { | 80 | { |
83 | $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry'); | ||
84 | // TODO don't give the user ID like this | ||
85 | // TODO change pagination | 81 | // TODO change pagination |
86 | $entries = $repository->findArchiveByUser(1, 0); | 82 | $entries = $this->getDoctrine() |
83 | ->getRepository('WallabagCoreBundle:Entry') | ||
84 | ->findArchiveByUser($this->getUser()->getId(), 0); | ||
87 | 85 | ||
88 | return $this->render( | 86 | return $this->render( |
89 | 'WallabagCoreBundle:Entry:entries.html.twig', | 87 | 'WallabagCoreBundle:Entry:entries.html.twig', |
@@ -99,10 +97,10 @@ class EntryController extends Controller | |||
99 | */ | 97 | */ |
100 | public function showStarredAction() | 98 | public function showStarredAction() |
101 | { | 99 | { |
102 | $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:Entry'); | ||
103 | // TODO don't give the user ID like this | ||
104 | // TODO change pagination | 100 | // TODO change pagination |
105 | $entries = $repository->findStarredByUser(1, 0); | 101 | $entries = $this->getDoctrine() |
102 | ->getRepository('WallabagCoreBundle:Entry') | ||
103 | ->findStarredByUser($this->getUser()->getId(), 0); | ||
106 | 104 | ||
107 | return $this->render( | 105 | return $this->render( |
108 | 'WallabagCoreBundle:Entry:entries.html.twig', | 106 | 'WallabagCoreBundle:Entry:entries.html.twig', |