X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FEntity%2FEntry.php;h=4d7e001bed619a58bc85d1f1d886fd8f21130208;hb=cdd3010b478c9ca818dd6d22d03c81ef4a5ab208;hp=a629efc763e454fe28172256d3f326363fd44396;hpb=a7e2218e253138ed53e18b4775dce291c78246c5;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index a629efc7..4d7e001b 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -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; + } }