diff options
author | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-04-10 17:33:15 +0200 |
---|---|---|
committer | Nicolas LÅ“uillet <nicolas@loeuillet.org> | 2016-08-23 16:49:21 +0200 |
commit | f3d0cb91063840f2b05c63954d3fef3e5b8943fd (patch) | |
tree | 5ee9a0c73e7a3e4c8d6da1761a8ce23110f8125a /src/Wallabag/CoreBundle/Entity/Entry.php | |
parent | 1bee9e0760c89756ebab0b67f9ab7efc5c6a709b (diff) | |
download | wallabag-f3d0cb91063840f2b05c63954d3fef3e5b8943fd.tar.gz wallabag-f3d0cb91063840f2b05c63954d3fef3e5b8943fd.tar.zst wallabag-f3d0cb91063840f2b05c63954d3fef3e5b8943fd.zip |
Share entry with a public URL
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/Entry.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/Entry.php | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index ceae78b0..3c742828 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php | |||
@@ -38,6 +38,15 @@ class Entry | |||
38 | private $id; | 38 | private $id; |
39 | 39 | ||
40 | /** | 40 | /** |
41 | * @var int | ||
42 | * | ||
43 | * @ORM\Column(name="uuid", type="text", nullable=true) | ||
44 | * | ||
45 | * @Groups({"entries_for_user", "export_all"}) | ||
46 | */ | ||
47 | private $uuid; | ||
48 | |||
49 | /** | ||
41 | * @var string | 50 | * @var string |
42 | * | 51 | * |
43 | * @ORM\Column(name="title", type="text", nullable=true) | 52 | * @ORM\Column(name="title", type="text", nullable=true) |
@@ -427,6 +436,8 @@ class Entry | |||
427 | } | 436 | } |
428 | 437 | ||
429 | $this->updatedAt = new \DateTime(); | 438 | $this->updatedAt = new \DateTime(); |
439 | |||
440 | $this->generateUuid(); | ||
430 | } | 441 | } |
431 | 442 | ||
432 | /** | 443 | /** |
@@ -595,4 +606,31 @@ class Entry | |||
595 | { | 606 | { |
596 | return $this->language; | 607 | return $this->language; |
597 | } | 608 | } |
609 | |||
610 | /** | ||
611 | * @return int | ||
612 | */ | ||
613 | public function getUuid() | ||
614 | { | ||
615 | return $this->uuid; | ||
616 | } | ||
617 | |||
618 | /** | ||
619 | * @param int $uuid | ||
620 | * | ||
621 | * @return Entry | ||
622 | */ | ||
623 | public function setUuid($uuid) | ||
624 | { | ||
625 | $this->uuid = $uuid; | ||
626 | |||
627 | return $this; | ||
628 | } | ||
629 | |||
630 | public function generateUuid() | ||
631 | { | ||
632 | if (empty($this->uuid) || is_null($this->uuid)) { | ||
633 | $this->uuid = uniqid(); | ||
634 | } | ||
635 | } | ||
598 | } | 636 | } |