src/Entity/Training/Absence.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Training;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\Training\AbsenceRepository;
  5. use App\Traits\Actions;
  6. use Doctrine\Common\Collections\ArrayCollection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassAbsenceRepository::class)]
  9. #[ORM\Table(name'hs_tc_training_absence')]
  10. #[ApiResource]
  11. class Absence
  12. {
  13.     use Actions;
  14.     #[ORM\ManyToOne(inversedBy'absences')]
  15.     #[ORM\JoinColumn(nullablefalse)]
  16.     private ?Seance $seance null;
  17.     #[ORM\ManyToOne(inversedBy'absences')]
  18.     #[ORM\JoinColumn(nullablefalse)]
  19.     private ?Trainee $trainee null;
  20.     #[ORM\Column(length255nullabletrue)]
  21.     private ?string $reason null;
  22.     public function __construct()
  23.     {
  24.         // date_default_timezone_set('Africa/Casablanca');
  25.         $this->createAt=new \DateTime('now');
  26.         $this->published=false;
  27.     }
  28.     public function getSeance(): ?Seance
  29.     {
  30.         return $this->seance;
  31.     }
  32.     public function setSeance(?Seance $seance): self
  33.     {
  34.         $this->seance $seance;
  35.         return $this;
  36.     }
  37.     public function getTrainee(): ?Trainee
  38.     {
  39.         return $this->trainee;
  40.     }
  41.     public function setTrainee(?Trainee $trainee): self
  42.     {
  43.         $this->trainee $trainee;
  44.         return $this;
  45.     }
  46.     public function getReason(): ?string
  47.     {
  48.         return $this->reason;
  49.     }
  50.     public function setReason(?string $reason): self
  51.     {
  52.         $this->reason $reason;
  53.         return $this;
  54.     }
  55. }