]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/Entry.php
Merge remote-tracking branch 'origin/master' into 2.1
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / Entry.php
index a629efc763e454fe28172256d3f326363fd44396..4d7e001bed619a58bc85d1f1d886fd8f21130208 100644 (file)
@@ -38,7 +38,7 @@ class Entry
     private $id;
 
     /**
-     * @var int
+     * @var string
      *
      * @ORM\Column(name="uuid", type="text", nullable=true)
      *
@@ -436,8 +436,6 @@ class Entry
         }
 
         $this->updatedAt = new \DateTime();
-
-        $this->generateUuid();
     }
 
     /**
@@ -608,7 +606,7 @@ class Entry
     }
 
     /**
-     * @return int
+     * @return string
      */
     public function getUuid()
     {
@@ -616,7 +614,7 @@ class Entry
     }
 
     /**
-     * @param int $uuid
+     * @param string $uuid
      *
      * @return Entry
      */
@@ -629,9 +627,14 @@ class Entry
 
     public function generateUuid()
     {
-        if (empty($this->uuid) || is_null($this->uuid)) {
+        if (null === $this->uuid) {
             // @see http://blog.kevingomez.fr/til/2015/07/26/why-is-uniqid-slow/ for true parameter
             $this->uuid = uniqid('', true);
         }
     }
+
+    public function cleanUuid()
+    {
+        $this->uuid = null;
+    }
 }