aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
diff options
context:
space:
mode:
authorNicolas Lœuillet <nicolas@loeuillet.org>2015-01-31 15:14:10 +0100
committerNicolas Lœuillet <nicolas@loeuillet.org>2015-01-31 15:14:10 +0100
commitc3235553ddc2bb5965f6fe00e750cfe4aac9ccdf (patch)
tree271305a039d31059c7af8be220da08b9331baeec /src/Wallabag/CoreBundle/Controller/WallabagRestController.php
parent71691fe44a7b2a80f3b9d96d54720cce7994ad08 (diff)
downloadwallabag-c3235553ddc2bb5965f6fe00e750cfe4aac9ccdf.tar.gz
wallabag-c3235553ddc2bb5965f6fe00e750cfe4aac9ccdf.tar.zst
wallabag-c3235553ddc2bb5965f6fe00e750cfe4aac9ccdf.zip
first implementation of security
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();