aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--composer.lock8
-rw-r--r--src/Wallabag/CoreBundle/Controller/WallabagRestController.php18
2 files changed, 21 insertions, 5 deletions
diff --git a/composer.lock b/composer.lock
index 716dea4a..21b67941 100644
--- a/composer.lock
+++ b/composer.lock
@@ -2283,12 +2283,12 @@
2283 "source": { 2283 "source": {
2284 "type": "git", 2284 "type": "git",
2285 "url": "https://github.com/tecnickcom/TCPDF.git", 2285 "url": "https://github.com/tecnickcom/TCPDF.git",
2286 "reference": "da2fe9359426ca334417549248307f33cd042ace" 2286 "reference": "a2e8f5b505a7a14a4ed960313c4baf699fd1f4bb"
2287 }, 2287 },
2288 "dist": { 2288 "dist": {
2289 "type": "zip", 2289 "type": "zip",
2290 "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/da2fe9359426ca334417549248307f33cd042ace", 2290 "url": "https://api.github.com/repos/tecnickcom/TCPDF/zipball/a2e8f5b505a7a14a4ed960313c4baf699fd1f4bb",
2291 "reference": "da2fe9359426ca334417549248307f33cd042ace", 2291 "reference": "a2e8f5b505a7a14a4ed960313c4baf699fd1f4bb",
2292 "shasum": "" 2292 "shasum": ""
2293 }, 2293 },
2294 "require": { 2294 "require": {
@@ -2338,7 +2338,7 @@
2338 "pdf417", 2338 "pdf417",
2339 "qrcode" 2339 "qrcode"
2340 ], 2340 ],
2341 "time": "2015-01-24 09:41:10" 2341 "time": "2015-01-28 18:51:40"
2342 }, 2342 },
2343 { 2343 {
2344 "name": "twig/extensions", 2344 "name": "twig/extensions",
diff --git a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
index eec8d32c..a6c0db37 100644
--- a/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
+++ b/src/Wallabag/CoreBundle/Controller/WallabagRestController.php
@@ -8,6 +8,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
8use Symfony\Component\HttpFoundation\Request; 8use Symfony\Component\HttpFoundation\Request;
9use Wallabag\CoreBundle\Entity\Entries; 9use Wallabag\CoreBundle\Entity\Entries;
10use Wallabag\CoreBundle\Entity\Tags; 10use Wallabag\CoreBundle\Entity\Tags;
11use Wallabag\CoreBundle\Service\Extractor;
11 12
12class WallabagRestController extends Controller 13class WallabagRestController extends Controller
13{ 14{
@@ -79,9 +80,24 @@ class WallabagRestController extends Controller
79 * } 80 * }
80 * ) 81 * )
81 */ 82 */
82 public function postEntriesAction() 83 public function postEntriesAction(Request $request)
83 { 84 {
85 //TODO la récup ne marche
86 //TODO gérer si on passe le titre
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
89 $entry = new Entries();
90 $entry->setUserId(1);
91 $content = Extractor::extract($request->request->get('url'));
84 92
93 $entry->setTitle($content->getTitle());
94 $entry->setContent($content->getBody());
95
96 $em = $this->getDoctrine()->getManager();
97 $em->persist($entry);
98 $em->flush();
99
100 return $entry;
85 } 101 }
86 102
87 /** 103 /**