src/Entity/Absence.php line 10

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AbsenceRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClassAbsenceRepository::class)]
  7. class Absence
  8. {
  9.     #[ORM\Id]
  10.     #[ORM\GeneratedValue]
  11.     #[ORM\Column]
  12.     private ?int $id null;
  13.     #[ORM\ManyToOne(inversedBy'absences')]
  14.     private ?User $user null;
  15.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  16.     private ?\DateTime $dateDemande null;
  17.     #[ORM\Column]
  18.     private ?int $valide null;
  19.     #[ORM\ManyToOne]
  20.     private ?AbsenceType $absenceType null;
  21.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  22.     private ?\DateTime $dateAnnulation null;
  23.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  24.     private ?\DateTime $dateDebut null;
  25.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  26.     private ?\DateTime $dateFin null;
  27.     const TEMPS_CONGES '08:35';
  28.     const TEMPS_FORMATION '07:00';
  29.     public function getId(): ?int
  30.     {
  31.         return $this->id;
  32.     }
  33.     public function getUser(): ?User
  34.     {
  35.         return $this->user;
  36.     }
  37.     public function setUser(?User $user): self
  38.     {
  39.         $this->user $user;
  40.         return $this;
  41.     }
  42.     public function getDateDemande(): ?\DateTime
  43.     {
  44.         return $this->dateDemande;
  45.     }
  46.     public function setDateDemande(\DateTime $dateDemande): self
  47.     {
  48.         $this->dateDemande $dateDemande;
  49.         return $this;
  50.     }
  51.     public function getValide(): ?int
  52.     {
  53.         return $this->valide;
  54.     }
  55.     public function setValide(int $valide): self
  56.     {
  57.         $this->valide $valide;
  58.         return $this;
  59.     }
  60.     public function getAbsenceType(): ?AbsenceType
  61.     {
  62.         return $this->absenceType;
  63.     }
  64.     public function setAbsenceType(?AbsenceType $absenceType): self
  65.     {
  66.         $this->absenceType $absenceType;
  67.         return $this;
  68.     }
  69.     public function getDateAnnulation(): ?\DateTime
  70.     {
  71.         return $this->dateAnnulation;
  72.     }
  73.     public function setDateAnnulation($dateAnnulation): self
  74.     {
  75.         $this->dateAnnulation $dateAnnulation;
  76.         return $this;
  77.     }
  78.     public function getDateDebut(): ?\DateTime
  79.     {
  80.         return $this->dateDebut;
  81.     }
  82.     public function setDateDebut(\DateTime $dateDebut): self
  83.     {
  84.         $this->dateDebut $dateDebut;
  85.         return $this;
  86.     }
  87.     public function getDateFin(): ?\DateTime
  88.     {
  89.         return $this->dateFin;
  90.     }
  91.     public function setDateFin(\DateTime $dateFin): self
  92.     {
  93.         $this->dateFin $dateFin;
  94.         return $this;
  95.     }
  96.     public function getDatePeriodeFr()
  97.     {
  98.         return ' du '.$this->getDateDebut()->format('d/m/Y').' au '.$this->getDateFin()->format('d/m/Y');
  99.     }
  100.     public function getAbsenceTypeIntitule()
  101.     {
  102.         return $this->getAbsenceType()->getNom();
  103.     }
  104. }