diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/Entry.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Entity/Entry.php | 42 |
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 | } |