forked from wallabag/wallabag
Share entry with a public URL
This commit is contained in:
@ -37,6 +37,15 @@ class Entry
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var int
|
||||
*
|
||||
* @ORM\Column(name="uuid", type="text", nullable=true)
|
||||
*
|
||||
* @Groups({"entries_for_user", "export_all"})
|
||||
*/
|
||||
private $uuid;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
@ -427,6 +436,8 @@ class Entry
|
||||
}
|
||||
|
||||
$this->updatedAt = new \DateTime();
|
||||
|
||||
$this->generateUuid();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -595,4 +606,31 @@ class Entry
|
||||
{
|
||||
return $this->language;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getUuid()
|
||||
{
|
||||
return $this->uuid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param int $uuid
|
||||
*
|
||||
* @return Entry
|
||||
*/
|
||||
public function setUuid($uuid)
|
||||
{
|
||||
$this->uuid = $uuid;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function generateUuid()
|
||||
{
|
||||
if (empty($this->uuid) || is_null($this->uuid)) {
|
||||
$this->uuid = uniqid();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user