aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller/EntryController.php
diff options
context:
space:
mode:
authorJeremy Benoist <j0k3r@users.noreply.github.com>2016-01-07 22:15:08 +0100
committerJeremy Benoist <j0k3r@users.noreply.github.com>2016-01-07 22:15:08 +0100
commit39643c6b76d92d509b1af0228b6379d7fdce8a1c (patch)
tree931dceef7dbc8ae9911d01ded709d558417a6cdd /src/Wallabag/CoreBundle/Controller/EntryController.php
parent488a468e3e11ff0ab6284afe232bf0f7fa68a8eb (diff)
parentb88cf91fc8371194df78e690983c61ea94f266cd (diff)
downloadwallabag-39643c6b76d92d509b1af0228b6379d7fdce8a1c.tar.gz
wallabag-39643c6b76d92d509b1af0228b6379d7fdce8a1c.tar.zst
wallabag-39643c6b76d92d509b1af0228b6379d7fdce8a1c.zip
Merge pull request #1493 from wallabag/v2-pocket-import2.0.0-alpha.1
v2 – 1st draft for Pocket import via API & Wallabag v1 import
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller/EntryController.php')
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index fa580133..37f7ab60 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -48,6 +48,19 @@ class EntryController extends Controller
48 $form->handleRequest($request); 48 $form->handleRequest($request);
49 49
50 if ($form->isValid()) { 50 if ($form->isValid()) {
51 // check for existing entry, if it exists, redirect to it with a message
52 $existingEntry = $this->get('wallabag_core.entry_repository')
53 ->existByUrlAndUserId($entry->getUrl(), $this->getUser()->getId());
54
55 if (false !== $existingEntry) {
56 $this->get('session')->getFlashBag()->add(
57 'notice',
58 'Entry already saved on '.$existingEntry['createdAt']->format('d-m-Y')
59 );
60
61 return $this->redirect($this->generateUrl('view', array('id' => $existingEntry['id'])));
62 }
63
51 $this->updateEntry($entry); 64 $this->updateEntry($entry);
52 $this->get('session')->getFlashBag()->add( 65 $this->get('session')->getFlashBag()->add(
53 'notice', 66 'notice',