forked from wallabag/wallabag
Renamed uuid to uid
This commit is contained in:
@ -539,8 +539,8 @@ class EntryController extends Controller
|
||||
{
|
||||
$this->checkUserAction($entry);
|
||||
|
||||
if (null === $entry->getUuid()) {
|
||||
$entry->generateUuid();
|
||||
if (null === $entry->getUid()) {
|
||||
$entry->generateUid();
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->persist($entry);
|
||||
@ -548,7 +548,7 @@ class EntryController extends Controller
|
||||
}
|
||||
|
||||
return $this->redirect($this->generateUrl('share_entry', [
|
||||
'uuid' => $entry->getUuid(),
|
||||
'uid' => $entry->getUid(),
|
||||
]));
|
||||
}
|
||||
|
||||
@ -565,7 +565,7 @@ class EntryController extends Controller
|
||||
{
|
||||
$this->checkUserAction($entry);
|
||||
|
||||
$entry->cleanUuid();
|
||||
$entry->cleanUid();
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->persist($entry);
|
||||
@ -581,7 +581,7 @@ class EntryController extends Controller
|
||||
*
|
||||
* @param Entry $entry
|
||||
*
|
||||
* @Route("/share/{uuid}", requirements={"uuid" = ".+"}, name="share_entry")
|
||||
* @Route("/share/{uid}", requirements={"uid" = ".+"}, name="share_entry")
|
||||
* @Cache(maxage="25200", smaxage="25200", public=true)
|
||||
*
|
||||
* @return \Symfony\Component\HttpFoundation\Response
|
||||
|
||||
@ -24,7 +24,7 @@ use Wallabag\AnnotationBundle\Entity\Annotation;
|
||||
* options={"collate"="utf8mb4_unicode_ci", "charset"="utf8mb4"},
|
||||
* indexes={
|
||||
* @ORM\Index(name="created_at", columns={"created_at"}),
|
||||
* @ORM\Index(name="uuid", columns={"uuid"})
|
||||
* @ORM\Index(name="uid", columns={"uid"})
|
||||
* }
|
||||
* )
|
||||
* @ORM\HasLifecycleCallbacks()
|
||||
@ -47,11 +47,11 @@ class Entry
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="uuid", type="string", length=23, nullable=true)
|
||||
* @ORM\Column(name="uid", type="string", length=23, nullable=true)
|
||||
*
|
||||
* @Groups({"entries_for_user", "export_all"})
|
||||
*/
|
||||
private $uuid;
|
||||
private $uid;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
@ -652,34 +652,34 @@ class Entry
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUuid()
|
||||
public function getUid()
|
||||
{
|
||||
return $this->uuid;
|
||||
return $this->uid;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $uuid
|
||||
* @param string $uid
|
||||
*
|
||||
* @return Entry
|
||||
*/
|
||||
public function setUuid($uuid)
|
||||
public function setUid($uid)
|
||||
{
|
||||
$this->uuid = $uuid;
|
||||
$this->uid = $uid;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function generateUuid()
|
||||
public function generateUid()
|
||||
{
|
||||
if (null === $this->uuid) {
|
||||
if (null === $this->uid) {
|
||||
// @see http://blog.kevingomez.fr/til/2015/07/26/why-is-uniqid-slow/ for true parameter
|
||||
$this->uuid = uniqid('', true);
|
||||
$this->uid = uniqid('', true);
|
||||
}
|
||||
}
|
||||
|
||||
public function cleanUuid()
|
||||
public function cleanUid()
|
||||
{
|
||||
$this->uuid = null;
|
||||
$this->uid = null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user