Entité
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user