aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity/Entry.php
diff options
context:
space:
mode:
authorJeremy Benoist <j0k3r@users.noreply.github.com>2016-08-25 09:30:51 +0200
committerGitHub <noreply@github.com>2016-08-25 09:30:51 +0200
commit60e722040665c836fb9d3c4a35c37aad5c1cba64 (patch)
tree4e90d355a5c12c311dec4d569dfc256ebef110f2 /src/Wallabag/CoreBundle/Entity/Entry.php
parenta1ab7d1d32cb69af563fcec4395fce5217f154f7 (diff)
parenteddda878a0ec375fa738e3228a72dd01b23e0fab (diff)
downloadwallabag-60e722040665c836fb9d3c4a35c37aad5c1cba64.tar.gz
wallabag-60e722040665c836fb9d3c4a35c37aad5c1cba64.tar.zst
wallabag-60e722040665c836fb9d3c4a35c37aad5c1cba64.zip
Merge pull request #1904 from wallabag/feature-public-mode
Share entry with a public URL
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/Entry.php')
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entry.php42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php
index ceae78b0..4d7e001b 100644
--- a/src/Wallabag/CoreBundle/Entity/Entry.php
+++ b/src/Wallabag/CoreBundle/Entity/Entry.php
@@ -40,6 +40,15 @@ class Entry
40 /** 40 /**
41 * @var string 41 * @var string
42 * 42 *
43 * @ORM\Column(name="uuid", type="text", nullable=true)
44 *
45 * @Groups({"entries_for_user", "export_all"})
46 */
47 private $uuid;
48
49 /**
50 * @var string
51 *
43 * @ORM\Column(name="title", type="text", nullable=true) 52 * @ORM\Column(name="title", type="text", nullable=true)
44 * 53 *
45 * @Groups({"entries_for_user", "export_all"}) 54 * @Groups({"entries_for_user", "export_all"})
@@ -595,4 +604,37 @@ class Entry
595 { 604 {
596 return $this->language; 605 return $this->language;
597 } 606 }
607
608 /**
609 * @return string
610 */
611 public function getUuid()
612 {
613 return $this->uuid;
614 }
615
616 /**
617 * @param string $uuid
618 *
619 * @return Entry
620 */
621 public function setUuid($uuid)
622 {
623 $this->uuid = $uuid;
624
625 return $this;
626 }
627
628 public function generateUuid()
629 {
630 if (null === $this->uuid) {
631 // @see http://blog.kevingomez.fr/til/2015/07/26/why-is-uniqid-slow/ for true parameter
632 $this->uuid = uniqid('', true);
633 }
634 }
635
636 public function cleanUuid()
637 {
638 $this->uuid = null;
639 }
598} 640}