aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/Wallabag/ApiBundle/Controller/EntryRestController.php12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
index c09fdaeb..5158171e 100644
--- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php
+++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php
@@ -239,12 +239,12 @@ class EntryRestController extends WallabagRestController
239 $results[$key]['url'] = $url; 239 $results[$key]['url'] = $url;
240 240
241 if (false !== $entry) { 241 if (false !== $entry) {
242 // entry deleted, dispatch event about it!
243 $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
244
242 $em = $this->getDoctrine()->getManager(); 245 $em = $this->getDoctrine()->getManager();
243 $em->remove($entry); 246 $em->remove($entry);
244 $em->flush(); 247 $em->flush();
245
246 // entry deleted, dispatch event about it!
247 $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
248 } 248 }
249 249
250 $results[$key]['entry'] = $entry instanceof Entry ? true : false; 250 $results[$key]['entry'] = $entry instanceof Entry ? true : false;
@@ -610,13 +610,13 @@ class EntryRestController extends WallabagRestController
610 $response = $this->sendResponse($e); 610 $response = $this->sendResponse($e);
611 } 611 }
612 612
613 // entry deleted, dispatch event about it!
614 $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
615
613 $em = $this->getDoctrine()->getManager(); 616 $em = $this->getDoctrine()->getManager();
614 $em->remove($entry); 617 $em->remove($entry);
615 $em->flush(); 618 $em->flush();
616 619
617 // entry deleted, dispatch event about it!
618 $this->get('event_dispatcher')->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
619
620 return $response; 620 return $response;
621 } 621 }
622 622