use Wallabag\CoreBundle\Form\Type\EntryFilterType;
use Wallabag\CoreBundle\Form\Type\EditEntryType;
use Wallabag\CoreBundle\Form\Type\NewEntryType;
+use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
class EntryController extends Controller
{
{
$this->checkUserAction($entry);
+ $this->generateEntryUuid($entry);
+
return $this->render(
'WallabagCoreBundle:Entry:entry.html.twig',
['entry' => $entry]
{
return $this->get('wallabag_core.entry_repository')->findByUrlAndUserId($entry->getUrl(), $this->getUser()->getId());
}
+
+ /**
+ * Share entry content.
+ *
+ * @param Entry $entry
+ *
+ * @Route("/share/{uuid}", requirements={"uuid" = ".+"}, name="share")
+ * @Cache(maxage="25200", public=true)
+ *
+ * @return \Symfony\Component\HttpFoundation\Response
+ */
+ public function shareEntryAction(Entry $entry)
+ {
+ return $this->render(
+ '@WallabagCore/themes/share.html.twig',
+ array('entry' => $entry)
+ );
+ }
+
+ /**
+ * @param Entry $entry
+ */
+ private function generateEntryUuid(Entry $entry)
+ {
+ $entry->generateUuid();
+ $em = $this->getDoctrine()->getManager();
+ $em->persist($entry);
+ $em->flush();
+ }
}