aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-02-09 12:52:06 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-02-09 12:52:06 +0100
commit89c03230c3d51e618608b044b0e3f45cf0c06a11 (patch)
tree504e54ecfd8ae6203f76a19a910e5e6c5dee1c3e /src/Wallabag/CoreBundle/Controller
parent8af35ad932177e0363412a868afc128b406e3322 (diff)
parent3b815d2de5a852fe2ebad5827bd4c9070aa175ea (diff)
downloadwallabag-89c03230c3d51e618608b044b0e3f45cf0c06a11.tar.gz
wallabag-89c03230c3d51e618608b044b0e3f45cf0c06a11.tar.zst
wallabag-89c03230c3d51e618608b044b0e3f45cf0c06a11.zip
Merge pull request #1062 from wallabag/v2-relation-entry-user
add a real relation between user and entry
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller')
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php21
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',