aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/WallabagRestController.php')
-rw-r--r--src/Wallabag/CoreBundle/Controller/WallabagRestController.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
index a6c0db37..8e018e88 100644
--- a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
+++ b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
@@ -82,17 +82,18 @@ class WallabagRestController extends Controller
82 */ 82 */
83 public function postEntriesAction(Request $request) 83 public function postEntriesAction(Request $request)
84 { 84 {
85 //TODO la récup ne marche 85 //TODO la récup ne marche pas
86 //TODO gérer si on passe le titre 86 //TODO gérer si on passe le titre
87 //TODO gérer si on passe les tags 87 //TODO gérer si on passe les tags
88 //TODO ne pas avoir du code comme ça qui doit se trouver dans le Repository 88 //TODO ne pas avoir du code comme ça qui doit se trouver dans le Repository
89 $url = $request->request->get('url');
90
91 $content = Extractor::extract($url);
89 $entry = new Entries(); 92 $entry = new Entries();
90 $entry->setUserId(1); 93 $entry->setUserId(1);
91 $content = Extractor::extract($request->request->get('url')); 94 $entry->setUrl($url);
92
93 $entry->setTitle($content->getTitle()); 95 $entry->setTitle($content->getTitle());
94 $entry->setContent($content->getBody()); 96 $entry->setContent($content->getBody());
95
96 $em = $this->getDoctrine()->getManager(); 97 $em = $this->getDoctrine()->getManager();
97 $em->persist($entry); 98 $em->persist($entry);
98 $em->flush(); 99 $em->flush();