]> git.immae.eu Git - github/wallabag/wallabag.git/commitdiff
create an Entry with a User in parameter
authorNicolas LÅ“uillet <nicolas@loeuillet.org>
Sat, 7 Feb 2015 21:32:21 +0000 (22:32 +0100)
committerJeremy <jeremy.benoist@gmail.com>
Sun, 8 Feb 2015 22:13:40 +0000 (23:13 +0100)
src/Wallabag/CoreBundle/Controller/EntryController.php

index 6326d31fc5b2f4d2073cf71430e320b1b5e55716..2dfe2f51379608ce87e7079276e114f4c04979b8 100644 (file)
@@ -19,8 +19,9 @@ class EntryController extends Controller
      */
     public function addEntryAction(Request $request)
     {
-        $entry = new Entry();
-        $entry->setUserId(1);
+        $repository = $this->getDoctrine()->getRepository('WallabagCoreBundle:User');
+        $user = $repository->find(1);
+        $entry = new Entry($user);
 
         $form = $this->createFormBuilder($entry)
             ->add('url', 'url')