src/Entity/Absence.php line 10

Open in your IDE?
  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.     const ON_HOLD 0;
  10.     const APPROVED 1;
  11.     const REJECTED 2;
  12.     const DELETED 3;
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column]
  18.     private ?\DateTimeImmutable $createdAt null;
  19.     #[ORM\Column(nullabletrue)]
  20.     private ?int $slot null;
  21.     #[ORM\ManyToOne(inversedBy'absences')]
  22.     #[ORM\JoinColumn(nullablefalse)]
  23.     private ?User $employee null;
  24.     #[ORM\ManyToOne]
  25.     #[ORM\JoinColumn(nullablefalse)]
  26.     private ?AbsenceType $type null;
  27.     #[ORM\Column]
  28.     private ?int $status null;
  29.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  30.     private ?\DateTimeInterface $startDate null;
  31.     #[ORM\Column(typeTypes::DATE_MUTABLE)]
  32.     private ?\DateTimeInterface $endDate null;
  33.     public function __construct()
  34.     {
  35.         $this->status self::ON_HOLD;
  36.     }
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getCreatedAt(): ?\DateTimeImmutable
  42.     {
  43.         return $this->createdAt;
  44.     }
  45.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  46.     {
  47.         $this->createdAt $createdAt;
  48.         return $this;
  49.     }
  50.     public function getSlot(): ?int
  51.     {
  52.         return $this->slot;
  53.     }
  54.     public function setSlot(?int $slot): self
  55.     {
  56.         $this->slot $slot;
  57.         return $this;
  58.     }
  59.     public function getEmployee(): ?User
  60.     {
  61.         return $this->employee;
  62.     }
  63.     public function setEmployee(?User $employee): self
  64.     {
  65.         $this->employee $employee;
  66.         return $this;
  67.     }
  68.     public function getType(): ?AbsenceType
  69.     {
  70.         return $this->type;
  71.     }
  72.     public function setType(?AbsenceType $type): self
  73.     {
  74.         $this->type $type;
  75.         return $this;
  76.     }
  77.     public function getStatus(): ?int
  78.     {
  79.         return $this->status;
  80.     }
  81.     public function setStatus(int $status): self
  82.     {
  83.         $this->status $status;
  84.         return $this;
  85.     }
  86.     public function getStartDate(): ?\DateTimeInterface
  87.     {
  88.         return $this->startDate;
  89.     }
  90.     public function setStartDate(\DateTimeInterface $startDate): self
  91.     {
  92.         $this->startDate $startDate;
  93.         return $this;
  94.     }
  95.     public function getEndDate(): ?\DateTimeInterface
  96.     {
  97.         return $this->endDate;
  98.     }
  99.     public function setEndDate(\DateTimeInterface $endDate): self
  100.     {
  101.         $this->endDate $endDate;
  102.         return $this;
  103.     }
  104. }