Commit 37e69692 authored by Dominique Merle's avatar Dominique Merle 💬
Browse files

Use UUIDs for polls and votes.

parent 61fd5538
......@@ -9,6 +9,7 @@ use ApiPlatform\Core\Annotation\ApiSubresource;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Ramsey\Uuid\UuidInterface;
use Symfony\Component\Serializer\Annotation\Groups;
......@@ -45,8 +46,13 @@ class LimajuPoll
/**
* @ORM\Id()
* @var UuidInterface
*
* @Groups({ "read" })
* @ORM\Id
* @ORM\Column(type="uuid", unique=true)
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator")
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
......@@ -84,7 +90,7 @@ class LimajuPoll
$this->options = new ArrayCollection();
}
public function getId(): ?int
public function getId(): ?UuidInterface
{
return $this->id;
}
......
......@@ -6,6 +6,7 @@ namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use Doctrine\ORM\Mapping as ORM;
use Ramsey\Uuid\UuidInterface;
use Symfony\Component\Serializer\Annotation\Groups;
/**
......@@ -30,9 +31,13 @@ use Symfony\Component\Serializer\Annotation\Groups;
class LimajuPollOptionVote
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
* @var UuidInterface
*
* @Groups({ "read" })
* @ORM\Id
* @ORM\Column(type="uuid", unique=true)
* @ORM\GeneratedValue(strategy="CUSTOM")
* @ORM\CustomIdGenerator(class="Ramsey\Uuid\Doctrine\UuidGenerator")
*/
private $id;
......@@ -80,7 +85,7 @@ class LimajuPollOptionVote
public function getId(): ?int
public function getId(): ?UuidInterface
{
return $this->id;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment