aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/EntryController.php
diff options
context:
space:
mode:
authorNicolas LÅ“uillet <nicolas@loeuillet.org>2015-01-26 22:15:19 +0100
committerNicolas LÅ“uillet <nicolas@loeuillet.org>2015-01-26 22:15:19 +0100
commit6b767d1cc0e9697af95ec399fd612d203d10826a (patch)
tree5257200fa45da0218a9c63f0738f18eb6c876775 /src/Wallabag/CoreBundle/Controller/EntryController.php
parentad4d1caa9e744af57ca58a4e57576533eb682d00 (diff)
downloadwallabag-6b767d1cc0e9697af95ec399fd612d203d10826a.tar.gz
wallabag-6b767d1cc0e9697af95ec399fd612d203d10826a.tar.zst
wallabag-6b767d1cc0e9697af95ec399fd612d203d10826a.zip
refactoring for fetching content
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/EntryController.php')
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index 2ebb416c..48d19307 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -7,6 +7,7 @@ use Symfony\Bundle\FrameworkBundle\Controller\Controller;
7use Symfony\Component\HttpFoundation\Request; 7use Symfony\Component\HttpFoundation\Request;
8use Wallabag\CoreBundle\Repository; 8use Wallabag\CoreBundle\Repository;
9use Wallabag\CoreBundle\Entity\Entries; 9use Wallabag\CoreBundle\Entity\Entries;
10use Wallabag\CoreBundle\Service\Extractor;
10use Wallabag\Wallabag\Tools; 11use Wallabag\Wallabag\Tools;
11use Wallabag\Wallabag\Url; 12use Wallabag\Wallabag\Url;
12 13
@@ -32,10 +33,12 @@ class EntryController extends Controller
32 33
33 if ($form->isValid()) { 34 if ($form->isValid()) {
34 35
35 $content = Tools::getPageContent(new Url($entry->getUrl())); 36 $content = Extractor::extract($entry->getUrl());
36 var_dump($content);die;
37 37
38 $em = $this->getDoctrine()->getEntityManager(); 38 $entry->setTitle($content->getTitle());
39 $entry->setContent($content->getBody());
40
41 $em = $this->getDoctrine()->getManager();
39 $em->persist($entry); 42 $em->persist($entry);
40 $em->flush(); 43 $em->flush();
41 44
@@ -170,7 +173,7 @@ class EntryController extends Controller
170 */ 173 */
171 public function deleteEntryAction(Request $request, Entries $entry) 174 public function deleteEntryAction(Request $request, Entries $entry)
172 { 175 {
173 $em = $this->getDoctrine()->getEntityManager(); 176 $em = $this->getDoctrine()->getManager();
174 $em->remove($entry); 177 $em->remove($entry);
175 $em->flush(); 178 $em->flush();
176 179