This commit is contained in:
marvin
2024-11-19 10:36:49 +01:00
parent 3abf0ff6c1
commit 1f803557aa
8 changed files with 19 additions and 99 deletions

View File

@@ -6,16 +6,15 @@ use App\Repository\LieuRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Uid\Uuid;
#[ORM\Entity(repositoryClass: LieuRepository::class)]
class Lieu
{
#[ORM\Id]
#[ORM\Column(type: 'uuid', unique: true)]
#[ORM\Column(type: 'guid', unique: true)]
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
private ?Uuid $idLieu = null;
private ?string $idLieu = null;
#[ORM\Column(length: 255)]
private ?string $nom = null;
@@ -41,11 +40,10 @@ class Lieu
public function __construct()
{
$this->idLieu = Uuid::v4(); // Génération automatique d'un UUID
$this->sorties = new ArrayCollection();
}
public function getIdLieu(): ?Uuid
public function getIdLieu(): ?string
{
return $this->idLieu;
}