entité
This commit is contained in:
@@ -5,19 +5,16 @@ namespace App\Entity;
|
||||
use App\Repository\SortieRepository;
|
||||
use Doctrine\DBAL\Types\Types;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\Types\UuidType;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
|
||||
#[ORM\Entity(repositoryClass: SortieRepository::class)]
|
||||
class Sortie
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(type: UuidType::NAME, unique: true)]
|
||||
#[ORM\Column(type: 'uuid', unique: true)]
|
||||
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
|
||||
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
|
||||
private ?Uuid $idSortie;
|
||||
|
||||
|
||||
private ?Uuid $idSortie = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $nom = null;
|
||||
@@ -40,35 +37,35 @@ class Sortie
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $état = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'sorties')]
|
||||
private ?Site $site = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'sorties')]
|
||||
private ?Participant $participant = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'sorties')]
|
||||
private ?Lieu $lieu = null;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'Sortie')]
|
||||
private ?Etat $etat = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
// Génère un UUID automatiquement lors de la création de l'entité
|
||||
$this->id = Uuid::v4();
|
||||
$this->idSortie = Uuid::v4();
|
||||
}
|
||||
|
||||
public function getId(): ?Uuid
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getIdSortie(): ?int
|
||||
public function getIdSortie(): ?Uuid
|
||||
{
|
||||
return $this->idSortie;
|
||||
}
|
||||
|
||||
public function setIdSortie(int $idSortie): static
|
||||
{
|
||||
$this->idSortie = $idSortie;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getNom(): ?string
|
||||
{
|
||||
return $this->nom;
|
||||
}
|
||||
|
||||
public function setNom(string $nom): static
|
||||
public function setNom(string $nom): self
|
||||
{
|
||||
$this->nom = $nom;
|
||||
|
||||
@@ -80,7 +77,7 @@ class Sortie
|
||||
return $this->dateHeureDebut;
|
||||
}
|
||||
|
||||
public function setDateHeureDebut(?\DateTimeInterface $dateHeureDebut): static
|
||||
public function setDateHeureDebut(?\DateTimeInterface $dateHeureDebut): self
|
||||
{
|
||||
$this->dateHeureDebut = $dateHeureDebut;
|
||||
|
||||
@@ -92,7 +89,7 @@ class Sortie
|
||||
return $this->durée;
|
||||
}
|
||||
|
||||
public function setDurée(?int $durée): static
|
||||
public function setDurée(?int $durée): self
|
||||
{
|
||||
$this->durée = $durée;
|
||||
|
||||
@@ -104,7 +101,7 @@ class Sortie
|
||||
return $this->dateLimiteInscription;
|
||||
}
|
||||
|
||||
public function setDateLimiteInscription(?\DateTimeInterface $dateLimiteInscription): static
|
||||
public function setDateLimiteInscription(?\DateTimeInterface $dateLimiteInscription): self
|
||||
{
|
||||
$this->dateLimiteInscription = $dateLimiteInscription;
|
||||
|
||||
@@ -116,7 +113,7 @@ class Sortie
|
||||
return $this->nbInscriptionsMax;
|
||||
}
|
||||
|
||||
public function setNbInscriptionsMax(?int $nbInscriptionsMax): static
|
||||
public function setNbInscriptionsMax(?int $nbInscriptionsMax): self
|
||||
{
|
||||
$this->nbInscriptionsMax = $nbInscriptionsMax;
|
||||
|
||||
@@ -128,22 +125,70 @@ class Sortie
|
||||
return $this->infosSortie;
|
||||
}
|
||||
|
||||
public function setInfosSortie(?string $infosSortie): static
|
||||
public function setInfosSortie(?string $infosSortie): self
|
||||
{
|
||||
$this->infosSortie = $infosSortie;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getétat(): ?int
|
||||
public function getÉtat(): ?int
|
||||
{
|
||||
return $this->état;
|
||||
}
|
||||
|
||||
public function setétat(?int $état): static
|
||||
public function setÉtat(?int $état): self
|
||||
{
|
||||
$this->état = $état;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSite(): ?Site
|
||||
{
|
||||
return $this->site;
|
||||
}
|
||||
|
||||
public function setSite(?Site $site): self
|
||||
{
|
||||
$this->site = $site;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getParticipant(): ?Participant
|
||||
{
|
||||
return $this->participant;
|
||||
}
|
||||
|
||||
public function setParticipant(?Participant $participant): self
|
||||
{
|
||||
$this->participant = $participant;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLieu(): ?Lieu
|
||||
{
|
||||
return $this->lieu;
|
||||
}
|
||||
|
||||
public function setLieu(?Lieu $lieu): self
|
||||
{
|
||||
$this->lieu = $lieu;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getEtat(): ?Etat
|
||||
{
|
||||
return $this->etat;
|
||||
}
|
||||
|
||||
public function setEtat(?Etat $etat): static
|
||||
{
|
||||
$this->etat = $etat;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user