]> git.immae.eu Git - github/wallabag/wallabag.git/blobdiff - src/Wallabag/CoreBundle/Entity/Entry.php
Change share entry behavior
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Entity / Entry.php
index 3c742828522935830b11bc90c426946ef63acbdb..8c20cde22e938d9df424d9b2c823540071386a64 100644 (file)
@@ -436,8 +436,6 @@ class Entry
         }
 
         $this->updatedAt = new \DateTime();
-
-        $this->generateUuid();
     }
 
     /**
@@ -630,7 +628,13 @@ class Entry
     public function generateUuid()
     {
         if (empty($this->uuid) || is_null($this->uuid)) {
-            $this->uuid = uniqid();
+            // @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;
+    }
 }