<?php
namespace App\Entity;
use App\Repository\GroupeRepository;
use DateTimeInterface;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
#[ORM\Entity(repositoryClass: GroupeRepository::class)]
#[ORM\Table(name: 'groupes')]
class Groupe
{
//---------------------------------- ID ----------------------------------------------------//
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
//---------------------------------- DATE DEPART ----------------------------------------------------//
#[Assert\NotBlank(message: 'Entrez la date de départ')]
#[ORM\Column(type: Types::DATE_MUTABLE)]
private ?DateTimeInterface $dateDepart = null;
//---------------------------------- DATE RETOUR ----------------------------------------------------//
#[ORM\Column(type: Types::DATE_MUTABLE)]
private ?DateTimeInterface $dateRetour = null;
//---------------------------------- HEURE DEPART ----------------------------------------------------//
#[ORM\Column(type: Types::TIME_MUTABLE)]
private ?DateTimeInterface $heureDepart = null;
//---------------------------------- HEURE RETOUR ----------------------------------------------------//
#[ORM\Column(type: Types::TIME_MUTABLE)]
private ?DateTimeInterface $heureRetour = null;
//---------------------------------- NOMBRE PERSONNES -------------------------------------------//
#[Assert\NotBlank(message: 'Entrez le nombre de personnes !')]
#[Assert\Regex(
pattern: '/\D/',
message: 'Cette valeur doit contenir que des chiffres !',
match: false,
)]
#[Assert\Range(
min: 8,
max: 100,
notInRangeMessage : 'Minimum {{ min }} - Au delàs de {{ max }} faites plusieurs groupes !',
) ]
#[ORM\Column]
private ?int $nbPersonnes = null;
//---------------------------------- PROGRAMME pour sejour -------------------------------------//
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $programme = null;
//---------------------------------- DETAIL transport (transfert et prestaion journee) ---------//
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $detail = null;
//---------------------------------- BUDGET ----------------------------------------------------//
#[Assert\Regex(
pattern: '/\D/',
message: 'Doit contenir que des chiffres !',
match: false,
)]#[ORM\Column(nullable: true)]
private ?int $budget = null;
// Champs suplementaire (non visible sur le formulaire)
//---------------------------------- DATE PARUTION ---------------------------------------------//
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?DateTimeInterface $dateParution = null;
//---------------------------------- ANNULE ----------------------------------------------------//
#[ORM\Column]
private ?bool $annule = null;
//---------------------------------- KILOMETRES ----------------------------------------------------//
#[Assert\Regex(
pattern: '/\D/',
message: 'Doit contenir que des chiffres !',
match: false,
)]
#[ORM\Column(nullable: true)]
private ?int $kilometres = null;
//---------------------------------- observations ----------------------------------------------------//
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $observation = null;
//--------------------------------- Plage horaire depart ------------------------------------------//
private ?string $plageHoraire = null;
//-----------------------------------------------------------------------------------------//
//---------------------------------------- RELATIONS --------------------------------------//
//---- Utilisateur (auteur du depot de groupe ----//
#[ORM\ManyToOne(inversedBy: 'groupes')]
private ?User $user = null;
//---- Adresse depart ----//
#[Assert\NotBlank]
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
private ?Adresse $adresseDepart = null;
//---- Adresse retour ----//
#[Assert\NotBlank]
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
private ?Adresse $adresseRetour = null;
//---- Type de client a transporter ----//
#[Assert\NotBlank]
#[Assert\Length(
min:5,
max:90,
maxMessage: 'Le nombre maximum de personnes est de {{ limit }} merci de faire plusieurs groupes')]
#[ORM\ManyToOne]
private ?TypeClient $typeClient = null;
//---- Type de groupe ----//
#[Assert\NotBlank]
#[ORM\ManyToOne]
private ?TypeGroupe $typeGroupe = null;
//---- Equipements ----//
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
private ?Equipement $equipements = null;
//---- Prestations (incluses) ----//
#[ORM\OneToOne(cascade: ['persist', 'remove'])]
private ?Prestation $prestation = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $filePdf = null;
public function getId(): ?int
{
return $this->id;
}
public function getDateDepart(): ?DateTimeInterface
{
return $this->dateDepart;
}
public function setDateDepart(DateTimeInterface $dateDepart): void
{
$this->dateDepart = $dateDepart;
}
public function getDateRetour(): ?DateTimeInterface
{
return $this->dateRetour;
}
public function setDateRetour(DateTimeInterface $dateRetour): void
{
$this->dateRetour = $dateRetour;
}
public function getHeureDepart(): ?DateTimeInterface
{
return $this->heureDepart;
}
public function setHeureDepart(DateTimeInterface $heureDepart): void
{
$this->heureDepart = $heureDepart;
}
public function getHeureRetour(): ?DateTimeInterface
{
return $this->heureRetour;
}
public function setHeureRetour(DateTimeInterface $heureRetour): void
{
$this->heureRetour = $heureRetour;
}
public function getNbPersonnes(): ?int
{
return $this->nbPersonnes;
}
public function setNbPersonnes(int $nbPersonnes): void
{
$this->nbPersonnes = $nbPersonnes;
}
public function getProgramme(): ?string
{
return $this->programme;
}
public function setProgramme(?string $programme): void
{
$this->programme = $programme;
}
public function getDetail(): ?string
{
return $this->detail;
}
public function setDetail(?string $detail): void
{
$this->detail = $detail;
}
public function getDateParution(): ?DateTimeInterface
{
return $this->dateParution;
}
public function setDateParution(DateTimeInterface $dateParution): void
{
$this->dateParution = $dateParution;
}
public function isAnnule(): ?bool
{
return $this->annule;
}
public function setAnnule(bool $annule): void
{
$this->annule = $annule;
}
public function getBudget(): ?int
{
return $this->budget;
}
public function setBudget(int $budget): void
{
$this->budget = $budget;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): void
{
$this->user = $user;
}
public function getAdresseDepart(): ?Adresse
{
return $this->adresseDepart;
}
public function setAdresseDepart(Adresse $adresseDepart): void
{
$this->adresseDepart = $adresseDepart;
}
public function getAdresseRetour(): ?Adresse
{
return $this->adresseRetour;
}
public function setAdresseRetour(Adresse $adresseRetour): void
{
$this->adresseRetour = $adresseRetour;
}
public function getTypeClient(): ?TypeClient
{
return $this->typeClient;
}
public function setTypeClient(?TypeClient $typeClient): void
{
$this->typeClient = $typeClient;
}
public function getPlageHoraire(): ?string
{
return $this->plageHoraire;
}
public function setPlageHoraire(?string $plageHoraire): void
{
$this->plageHoraire = $plageHoraire;
}
public function getTypeGroupe(): ?TypeGroupe
{
return $this->typeGroupe;
}
public function setTypeGroupe(?TypeGroupe $typeGroupe): void
{
$this->typeGroupe = $typeGroupe;
}
public function getEquipements(): ?Equipement
{
return $this->equipements;
}
public function setEquipements(Equipement $equipements): self
{
$this->equipements = $equipements;
return $this;
}
public function getPrestation(): ?Prestation
{
return $this->prestation;
}
public function setPrestation(?Prestation $prestation): self
{
$this->prestation = $prestation;
return $this;
}
public function getKilometres(): ?int
{
return $this->kilometres;
}
public function setKilometres(?int $kilometres): self
{
$this->kilometres = $kilometres;
return $this;
}
public function getObservation(): ?string
{
return $this->observation;
}
public function setObservation(?string $observation): self
{
$this->observation = $observation;
return $this;
}
public function getFilePdf(): ?string
{
return $this->filePdf;
}
public function setFilePdf(?string $filePdf): self
{
$this->filePdf = $filePdf;
return $this;
}
}