From 852273cae28d59a2db47f2a17ea20138ecfdb1ed Mon Sep 17 00:00:00 2001 From: Jeremy Benoist Date: Tue, 30 May 2017 11:51:08 +0200 Subject: Re-add one missing event --- src/Wallabag/ApiBundle/Controller/EntryRestController.php | 1 + src/Wallabag/CoreBundle/Controller/EntryController.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index 2cf562bc..808c4d7e 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php @@ -14,6 +14,7 @@ use Wallabag\CoreBundle\Entity\Tag; use Wallabag\CoreBundle\Event\EntrySavedEvent; use Wallabag\CoreBundle\Event\EntryTaggedEvent; use Wallabag\CoreBundle\Event\EntryUpdatedEvent; +use Wallabag\CoreBundle\Event\EntryDeletedEvent; class EntryRestController extends WallabagRestController { diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index 2a287825..b6afe129 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -15,6 +15,7 @@ use Wallabag\CoreBundle\Form\Type\EditEntryType; use Wallabag\CoreBundle\Form\Type\NewEntryType; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; use Wallabag\CoreBundle\Event\EntrySavedEvent; +use Wallabag\CoreBundle\Event\EntryDeletedEvent; use Wallabag\CoreBundle\Form\Type\SearchEntryType; class EntryController extends Controller @@ -486,6 +487,9 @@ class EntryController extends Controller UrlGeneratorInterface::ABSOLUTE_PATH ); + // entry deleted, dispatch event about it! + $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry)); + $em = $this->getDoctrine()->getManager(); $em->remove($entry); $em->flush(); -- cgit v1.2.3