aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Controller
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Controller')
-rw-r--r--src/Wallabag/CoreBundle/Controller/EntryController.php31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php
index 93db0d6c..a78dd00c 100644
--- a/src/Wallabag/CoreBundle/Controller/EntryController.php
+++ b/src/Wallabag/CoreBundle/Controller/EntryController.php
@@ -291,6 +291,8 @@ class EntryController extends Controller
291 { 291 {
292 $this->checkUserAction($entry); 292 $this->checkUserAction($entry);
293 293
294 $this->generateEntryUuid($entry);
295
294 return $this->render( 296 return $this->render(
295 'WallabagCoreBundle:Entry:entry.html.twig', 297 'WallabagCoreBundle:Entry:entry.html.twig',
296 ['entry' => $entry] 298 ['entry' => $entry]
@@ -449,5 +451,34 @@ class EntryController extends Controller
449 private function checkIfEntryAlreadyExists(Entry $entry) 451 private function checkIfEntryAlreadyExists(Entry $entry)
450 { 452 {
451 return $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($entry->getUrl(), $this->getUser()->getId()); 453 return $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($entry->getUrl(), $this->getUser()->getId());
454
455 }
456
457 /*
458 * Share entry content.
459 *
460 * @param Entry $entry
461 *
462 * @Route("/share/{uuid}", requirements={"uuid" = ".+"}, name="share")
463 *
464 * @return \Symfony\Component\HttpFoundation\Response
465 */
466 public function shareEntry(Entry $entry)
467 {
468 return $this->render(
469 '@WallabagCore/themes/share.html.twig',
470 array('entry' => $entry)
471 );
472 }
473
474 /**
475 * @param Entry $entry
476 */
477 private function generateEntryUuid(Entry $entry)
478 {
479 $entry->generateUuid();
480 $em = $this->getDoctrine()->getManager();
481 $em->persist($entry);
482 $em->flush();
452 } 483 }
453} 484}