aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Entity/Entry.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Entity/Entry.php')
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entry.php38
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}