Merge branch 'Marvin'
This commit is contained in:
81
src/Entity/Etat.php
Normal file
81
src/Entity/Etat.php
Normal file
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\EtatRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
|
||||
#[ORM\Entity(repositoryClass: EtatRepository::class)]
|
||||
class Etat
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(type: 'uuid', unique: true)]
|
||||
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
|
||||
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
|
||||
private ?Uuid $idEtat = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $libelle = null;
|
||||
|
||||
/**
|
||||
* @var Collection<int, Sortie>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Sortie::class, mappedBy: 'etat')]
|
||||
private Collection $sorties;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->idEtat = Uuid::v4(); // Génération automatique d'un UUID
|
||||
$this->sorties = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getIdEtat(): ?Uuid
|
||||
{
|
||||
return $this->idEtat;
|
||||
}
|
||||
|
||||
public function getLibelle(): ?string
|
||||
{
|
||||
return $this->libelle;
|
||||
}
|
||||
|
||||
public function setLibelle(string $libelle): self
|
||||
{
|
||||
$this->libelle = $libelle;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Sortie>
|
||||
*/
|
||||
public function getSorties(): Collection
|
||||
{
|
||||
return $this->sorties;
|
||||
}
|
||||
|
||||
public function addSortie(Sortie $sortie): self
|
||||
{
|
||||
if (!$this->sorties->contains($sortie)) {
|
||||
$this->sorties->add($sortie);
|
||||
$sortie->setEtat($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeSortie(Sortie $sortie): self
|
||||
{
|
||||
if ($this->sorties->removeElement($sortie)) {
|
||||
// Set the owning side to null (unless already changed)
|
||||
if ($sortie->getEtat() === $this) {
|
||||
$sortie->setEtat(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
142
src/Entity/Lieu.php
Normal file
142
src/Entity/Lieu.php
Normal file
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
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\GeneratedValue(strategy: 'CUSTOM')]
|
||||
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
|
||||
private ?Uuid $idLieu = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $nom = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $rue = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?float $latitude = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?float $longitude = null;
|
||||
|
||||
/**
|
||||
* @var Collection<int, Sortie>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Sortie::class, mappedBy: 'lieu')]
|
||||
private Collection $sorties;
|
||||
|
||||
#[ORM\ManyToOne(inversedBy: 'lieux')]
|
||||
#[ORM\JoinColumn(name: 'ville_id', referencedColumnName: 'idVille', nullable: false)]
|
||||
private ?Ville $ville = null;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->idLieu = Uuid::v4(); // Génération automatique d'un UUID
|
||||
$this->sorties = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getIdLieu(): ?Uuid
|
||||
{
|
||||
return $this->idLieu;
|
||||
}
|
||||
|
||||
public function getNom(): ?string
|
||||
{
|
||||
return $this->nom;
|
||||
}
|
||||
|
||||
public function setNom(string $nom): self
|
||||
{
|
||||
$this->nom = $nom;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRue(): ?string
|
||||
{
|
||||
return $this->rue;
|
||||
}
|
||||
|
||||
public function setRue(?string $rue): self
|
||||
{
|
||||
$this->rue = $rue;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLatitude(): ?float
|
||||
{
|
||||
return $this->latitude;
|
||||
}
|
||||
|
||||
public function setLatitude(?float $latitude): self
|
||||
{
|
||||
$this->latitude = $latitude;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getLongitude(): ?float
|
||||
{
|
||||
return $this->longitude;
|
||||
}
|
||||
|
||||
public function setLongitude(?float $longitude): self
|
||||
{
|
||||
$this->longitude = $longitude;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Sortie>
|
||||
*/
|
||||
public function getSorties(): Collection
|
||||
{
|
||||
return $this->sorties;
|
||||
}
|
||||
|
||||
public function addSortie(Sortie $sortie): self
|
||||
{
|
||||
if (!$this->sorties->contains($sortie)) {
|
||||
$this->sorties->add($sortie);
|
||||
$sortie->setLieu($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeSortie(Sortie $sortie): self
|
||||
{
|
||||
if ($this->sorties->removeElement($sortie)) {
|
||||
// Set the owning side to null (unless already changed)
|
||||
if ($sortie->getLieu() === $this) {
|
||||
$sortie->setLieu(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getVille(): ?Ville
|
||||
{
|
||||
return $this->ville;
|
||||
}
|
||||
|
||||
public function setVille(?Ville $ville): self
|
||||
{
|
||||
$this->ville = $ville;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
209
src/Entity/Participant.php
Normal file
209
src/Entity/Participant.php
Normal file
@@ -0,0 +1,209 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\ParticipantRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
|
||||
#[ORM\Entity(repositoryClass: ParticipantRepository::class)]
|
||||
class Participant
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(type: 'uuid', unique: true)]
|
||||
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
|
||||
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
|
||||
private ?Uuid $idParticipant = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $nom = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $prénom = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $telephone = null;
|
||||
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $mail = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?bool $administrateur = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private ?bool $actif = null;
|
||||
|
||||
#[ORM\Column]
|
||||
private array $roles = [];
|
||||
|
||||
#[ORM\Column]
|
||||
private ?string $password = null;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Site::class, inversedBy: 'participants')]
|
||||
#[ORM\JoinColumn(name: 'site_id', referencedColumnName: 'idSite', nullable: false)]
|
||||
private ?Site $site = null;
|
||||
|
||||
/**
|
||||
* @var Collection<int, Sortie>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Sortie::class, mappedBy: 'participant')]
|
||||
private Collection $sorties;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->idParticipant = Uuid::v4(); // Génération automatique de l'UUID
|
||||
$this->sorties = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getIdParticipant(): ?Uuid
|
||||
{
|
||||
return $this->idParticipant;
|
||||
}
|
||||
|
||||
public function getNom(): ?string
|
||||
{
|
||||
return $this->nom;
|
||||
}
|
||||
|
||||
public function setNom(string $nom): self
|
||||
{
|
||||
$this->nom = $nom;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPrénom(): ?string
|
||||
{
|
||||
return $this->prénom;
|
||||
}
|
||||
|
||||
public function setPrénom(string $prénom): self
|
||||
{
|
||||
$this->prénom = $prénom;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getTelephone(): ?string
|
||||
{
|
||||
return $this->telephone;
|
||||
}
|
||||
|
||||
public function setTelephone(?string $telephone): self
|
||||
{
|
||||
$this->telephone = $telephone;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getMail(): ?string
|
||||
{
|
||||
return $this->mail;
|
||||
}
|
||||
|
||||
public function setMail(?string $mail): self
|
||||
{
|
||||
$this->mail = $mail;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isAdministrateur(): ?bool
|
||||
{
|
||||
return $this->administrateur;
|
||||
}
|
||||
|
||||
public function setAdministrateur(bool $administrateur): self
|
||||
{
|
||||
$this->administrateur = $administrateur;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function isActif(): ?bool
|
||||
{
|
||||
return $this->actif;
|
||||
}
|
||||
|
||||
public function setActif(bool $actif): self
|
||||
{
|
||||
$this->actif = $actif;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getRoles(): array
|
||||
{
|
||||
$roles = $this->roles;
|
||||
// Garantit que chaque utilisateur a au moins le rôle ROLE_USER
|
||||
$roles[] = 'ROLE_USER';
|
||||
|
||||
return array_unique($roles);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<string> $roles
|
||||
*/
|
||||
public function setRoles(array $roles): self
|
||||
{
|
||||
$this->roles = $roles;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getPassword(): ?string
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
public function setPassword(string $password): self
|
||||
{
|
||||
$this->password = $password;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getSite(): ?Site
|
||||
{
|
||||
return $this->site;
|
||||
}
|
||||
|
||||
public function setSite(?Site $site): self
|
||||
{
|
||||
$this->site = $site;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Sortie>
|
||||
*/
|
||||
public function getSorties(): Collection
|
||||
{
|
||||
return $this->sorties;
|
||||
}
|
||||
|
||||
public function addSortie(Sortie $sortie): self
|
||||
{
|
||||
if (!$this->sorties->contains($sortie)) {
|
||||
$this->sorties->add($sortie);
|
||||
$sortie->setParticipant($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeSortie(Sortie $sortie): self
|
||||
{
|
||||
if ($this->sorties->removeElement($sortie)) {
|
||||
// Set the owning side to null (unless already changed)
|
||||
if ($sortie->getParticipant() === $this) {
|
||||
$sortie->setParticipant(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
118
src/Entity/Site.php
Normal file
118
src/Entity/Site.php
Normal file
@@ -0,0 +1,118 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\SiteRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
|
||||
#[ORM\Entity(repositoryClass: SiteRepository::class)]
|
||||
class Site
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(type: 'uuid', unique: true)]
|
||||
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
|
||||
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
|
||||
private ?Uuid $idSite = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $nom = null;
|
||||
|
||||
/**
|
||||
* @var Collection<int, Sortie>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Sortie::class, mappedBy: 'site')]
|
||||
private Collection $sorties;
|
||||
|
||||
/**
|
||||
* @var Collection<int, Participant>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Participant::class, mappedBy: 'site')]
|
||||
private Collection $participants;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->idSite = Uuid::v4(); // Génération automatique de l'UUID
|
||||
$this->sorties = new ArrayCollection();
|
||||
$this->participants = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getIdSite(): ?Uuid
|
||||
{
|
||||
return $this->idSite;
|
||||
}
|
||||
|
||||
public function getNom(): ?string
|
||||
{
|
||||
return $this->nom;
|
||||
}
|
||||
|
||||
public function setNom(string $nom): self
|
||||
{
|
||||
$this->nom = $nom;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Sortie>
|
||||
*/
|
||||
public function getSorties(): Collection
|
||||
{
|
||||
return $this->sorties;
|
||||
}
|
||||
|
||||
public function addSorty(Sortie $sorty): self
|
||||
{
|
||||
if (!$this->sorties->contains($sorty)) {
|
||||
$this->sorties->add($sorty);
|
||||
$sorty->setSite($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeSorty(Sortie $sorty): self
|
||||
{
|
||||
if ($this->sorties->removeElement($sorty)) {
|
||||
// Set the owning side to null (unless already changed)
|
||||
if ($sorty->getSite() === $this) {
|
||||
$sorty->setSite(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Participant>
|
||||
*/
|
||||
public function getParticipants(): Collection
|
||||
{
|
||||
return $this->participants;
|
||||
}
|
||||
|
||||
public function addParticipant(Participant $participant): self
|
||||
{
|
||||
if (!$this->participants->contains($participant)) {
|
||||
$this->participants->add($participant);
|
||||
$participant->setSite($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeParticipant(Participant $participant): self
|
||||
{
|
||||
if ($this->participants->removeElement($participant)) {
|
||||
// Set the owning side to null (unless already changed)
|
||||
if ($participant->getSite() === $this) {
|
||||
$participant->setSite(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
@@ -37,38 +34,38 @@ class Sortie
|
||||
#[ORM\Column(length: 255, nullable: true)]
|
||||
private ?string $infosSortie = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $état = null;
|
||||
#[ORM\ManyToOne(targetEntity: Site::class, inversedBy: 'sorties')]
|
||||
#[ORM\JoinColumn(name: 'site_id', referencedColumnName: 'idSite', nullable: false)]
|
||||
private ?Site $site = null;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Participant::class, inversedBy: 'sorties')]
|
||||
#[ORM\JoinColumn(name: 'participant_id', referencedColumnName: 'idParticipant', nullable: false)]
|
||||
private ?Participant $participant = null;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Lieu::class, inversedBy: 'sorties')]
|
||||
#[ORM\JoinColumn(name: 'lieu_id', referencedColumnName: 'idLieu', nullable: false)]
|
||||
private ?Lieu $lieu = null;
|
||||
|
||||
#[ORM\ManyToOne(targetEntity: Etat::class, inversedBy: 'sorties')]
|
||||
#[ORM\JoinColumn(name: 'etat_id', referencedColumnName: 'idEtat', nullable: false)]
|
||||
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(); // Génération automatique d'un UUID
|
||||
}
|
||||
|
||||
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,21 +125,57 @@ 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 getSite(): ?Site
|
||||
{
|
||||
return $this->état;
|
||||
return $this->site;
|
||||
}
|
||||
|
||||
public function setétat(?int $état): static
|
||||
public function setSite(?Site $site): self
|
||||
{
|
||||
$this->état = $état;
|
||||
$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): self
|
||||
{
|
||||
$this->etat = $etat;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -1,111 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\UserRepository;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
|
||||
use Symfony\Component\Security\Core\User\UserInterface;
|
||||
use Symfony\Bridge\Doctrine\Types\UuidType;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
|
||||
#[ORM\Entity(repositoryClass: UserRepository::class)]
|
||||
#[ORM\UniqueConstraint(name: 'UNIQ_IDENTIFIER_EMAIL', fields: ['email'])]
|
||||
class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(type: UuidType::NAME, unique: true)]
|
||||
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
|
||||
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
|
||||
private ?Uuid $uuid;
|
||||
|
||||
#[ORM\Column(length: 180)]
|
||||
private ?string $email = null;
|
||||
|
||||
/**
|
||||
* @var list<string> The user roles
|
||||
*/
|
||||
#[ORM\Column]
|
||||
private array $roles = [];
|
||||
|
||||
/**
|
||||
* @var string The hashed password
|
||||
*/
|
||||
#[ORM\Column]
|
||||
private ?string $password = null;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getEmail(): ?string
|
||||
{
|
||||
return $this->email;
|
||||
}
|
||||
|
||||
public function setEmail(string $email): static
|
||||
{
|
||||
$this->email = $email;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* A visual identifier that represents this user.
|
||||
*
|
||||
* @see UserInterface
|
||||
*/
|
||||
public function getUserIdentifier(): string
|
||||
{
|
||||
return (string) $this->email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see UserInterface
|
||||
*
|
||||
* @return list<string>
|
||||
*/
|
||||
public function getRoles(): array
|
||||
{
|
||||
$roles = $this->roles;
|
||||
// guarantee every user at least has ROLE_USER
|
||||
$roles[] = 'ROLE_USER';
|
||||
|
||||
return array_unique($roles);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param list<string> $roles
|
||||
*/
|
||||
public function setRoles(array $roles): static
|
||||
{
|
||||
$this->roles = $roles;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see PasswordAuthenticatedUserInterface
|
||||
*/
|
||||
public function getPassword(): ?string
|
||||
{
|
||||
return $this->password;
|
||||
}
|
||||
|
||||
public function setPassword(string $password): static
|
||||
{
|
||||
$this->password = $password;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see UserInterface
|
||||
*/
|
||||
public function eraseCredentials(): void
|
||||
{
|
||||
// If you store any temporary, sensitive data on the user, clear it here
|
||||
// $this->plainPassword = null;
|
||||
}
|
||||
}
|
||||
96
src/Entity/Ville.php
Normal file
96
src/Entity/Ville.php
Normal file
@@ -0,0 +1,96 @@
|
||||
<?php
|
||||
|
||||
namespace App\Entity;
|
||||
|
||||
use App\Repository\VilleRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
|
||||
#[ORM\Entity(repositoryClass: VilleRepository::class)]
|
||||
class Ville
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(type: 'uuid', unique: true)]
|
||||
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
|
||||
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
|
||||
private ?Uuid $idVille = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $nom = null;
|
||||
|
||||
#[ORM\Column(nullable: true)]
|
||||
private ?int $codePostal = null;
|
||||
|
||||
/**
|
||||
* @var Collection<int, Lieu>
|
||||
*/
|
||||
#[ORM\OneToMany(targetEntity: Lieu::class, mappedBy: 'ville')]
|
||||
private Collection $lieux;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->idVille = Uuid::v4(); // Génération automatique d'un UUID
|
||||
$this->lieux = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getIdVille(): ?Uuid
|
||||
{
|
||||
return $this->idVille;
|
||||
}
|
||||
|
||||
public function getNom(): ?string
|
||||
{
|
||||
return $this->nom;
|
||||
}
|
||||
|
||||
public function setNom(string $nom): self
|
||||
{
|
||||
$this->nom = $nom;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getCodePostal(): ?int
|
||||
{
|
||||
return $this->codePostal;
|
||||
}
|
||||
|
||||
public function setCodePostal(?int $codePostal): self
|
||||
{
|
||||
$this->codePostal = $codePostal;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Lieu>
|
||||
*/
|
||||
public function getLieux(): Collection
|
||||
{
|
||||
return $this->lieux;
|
||||
}
|
||||
|
||||
public function addLieu(Lieu $lieu): self
|
||||
{
|
||||
if (!$this->lieux->contains($lieu)) {
|
||||
$this->lieux->add($lieu);
|
||||
$lieu->setVille($this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeLieu(Lieu $lieu): self
|
||||
{
|
||||
if ($this->lieux->removeElement($lieu)) {
|
||||
// Set the owning side to null (unless already changed)
|
||||
if ($lieu->getVille() === $this) {
|
||||
$lieu->setVille(null);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
43
src/Repository/EtatRepository.php
Normal file
43
src/Repository/EtatRepository.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Etat;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Etat>
|
||||
*/
|
||||
class EtatRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Etat::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Etat[] Returns an array of Etat objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('e')
|
||||
// ->andWhere('e.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('e.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Etat
|
||||
// {
|
||||
// return $this->createQueryBuilder('e')
|
||||
// ->andWhere('e.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
43
src/Repository/LieuRepository.php
Normal file
43
src/Repository/LieuRepository.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Lieu;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Lieu>
|
||||
*/
|
||||
class LieuRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Lieu::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Lieu[] Returns an array of Lieu objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('l')
|
||||
// ->andWhere('l.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('l.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Lieu
|
||||
// {
|
||||
// return $this->createQueryBuilder('l')
|
||||
// ->andWhere('l.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
43
src/Repository/ParticipantRepository.php
Normal file
43
src/Repository/ParticipantRepository.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Participant;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Participant>
|
||||
*/
|
||||
class ParticipantRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Participant::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Participant[] Returns an array of Participant objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('p')
|
||||
// ->andWhere('p.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('p.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Participant
|
||||
// {
|
||||
// return $this->createQueryBuilder('p')
|
||||
// ->andWhere('p.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
43
src/Repository/SiteRepository.php
Normal file
43
src/Repository/SiteRepository.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Site;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Site>
|
||||
*/
|
||||
class SiteRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Site::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Site[] Returns an array of Site objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('s')
|
||||
// ->andWhere('s.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('s.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Site
|
||||
// {
|
||||
// return $this->createQueryBuilder('s')
|
||||
// ->andWhere('s.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
43
src/Repository/VilleRepository.php
Normal file
43
src/Repository/VilleRepository.php
Normal file
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
namespace App\Repository;
|
||||
|
||||
use App\Entity\Ville;
|
||||
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
||||
use Doctrine\Persistence\ManagerRegistry;
|
||||
|
||||
/**
|
||||
* @extends ServiceEntityRepository<Ville>
|
||||
*/
|
||||
class VilleRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
{
|
||||
parent::__construct($registry, Ville::class);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * @return Ville[] Returns an array of Ville objects
|
||||
// */
|
||||
// public function findByExampleField($value): array
|
||||
// {
|
||||
// return $this->createQueryBuilder('v')
|
||||
// ->andWhere('v.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->orderBy('v.id', 'ASC')
|
||||
// ->setMaxResults(10)
|
||||
// ->getQuery()
|
||||
// ->getResult()
|
||||
// ;
|
||||
// }
|
||||
|
||||
// public function findOneBySomeField($value): ?Ville
|
||||
// {
|
||||
// return $this->createQueryBuilder('v')
|
||||
// ->andWhere('v.exampleField = :val')
|
||||
// ->setParameter('val', $value)
|
||||
// ->getQuery()
|
||||
// ->getOneOrNullResult()
|
||||
// ;
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user