src/Entity/DailyAbsence.php line 19

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\Timestampable;
  4. use App\Repository\DailyAbsenceRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. // Absence journalière — écoles primaires/maternelles uniquement. L'appel s'y
  7. // fait une fois par jour pour toute la classe (pas par matière/période comme
  8. // au secondaire, voir Absence.php qui reste lié à AgendaElement/Exams et
  9. // n'est pas touché). startAt/endAt sont des DATETIME (pas juste une heure ou
  10. // une date) pour permettre un intervalle explicite sur plusieurs jours (ex:
  11. // absent de mardi 14h à jeudi 10h), en plus du cas simple "absent toute la
  12. // journée" (startAt = jour 00:00, endAt = jour 23:59:59). Entité neuve et
  13. // isolée : aucun rapport avec Absence/AgendaElement/Exams existants.
  14. #[ORM\HasLifecycleCallbacks]
  15. #[ORM\Entity(repositoryClassDailyAbsenceRepository::class)]
  16. class DailyAbsence
  17. {
  18.     use Timestampable;
  19.     #[ORM\Id]
  20.     #[ORM\GeneratedValue]
  21.     #[ORM\Column]
  22.     private ?int $id null;
  23.     #[ORM\ManyToOne]
  24.     #[ORM\JoinColumn(nullablefalse)]
  25.     private ?Student $student null;
  26.     #[ORM\ManyToOne]
  27.     #[ORM\JoinColumn(nullablefalse)]
  28.     private ?TheClass $classe null;
  29.     // Primaire/maternelle : absence rattachée à l'évaluation mensuelle (pas de
  30.     // séquence dans ce système), choisie explicitement par l'utilisateur au
  31.     // même titre que pour la saisie des notes (voir PrimaryComponentNote et
  32.     // PrimaryEvaluation). Le trimestre est accessible via getQuarter().
  33.     #[ORM\ManyToOne]
  34.     #[ORM\JoinColumn(nullablefalse)]
  35.     private ?PrimaryEvaluation $evaluation null;
  36.     #[ORM\Column]
  37.     private ?\DateTimeInterface $startAt null;
  38.     #[ORM\Column]
  39.     private ?\DateTimeInterface $endAt null;
  40.     #[ORM\Column]
  41.     private bool $justified false;
  42.     #[ORM\Column(length255nullabletrue)]
  43.     private ?string $motif null;
  44.     #[ORM\ManyToOne]
  45.     #[ORM\JoinColumn(nullablefalse)]
  46.     private ?School $school null;
  47.     #[ORM\ManyToOne]
  48.     #[ORM\JoinColumn(nullablefalse)]
  49.     private ?SchoolYear $year null;
  50.     #[ORM\ManyToOne]
  51.     #[ORM\JoinColumn(nullablefalse)]
  52.     private ?User $author null;
  53.     public function getId(): ?int
  54.     {
  55.         return $this->id;
  56.     }
  57.     public function getStudent(): ?Student
  58.     {
  59.         return $this->student;
  60.     }
  61.     public function setStudent(?Student $student): static
  62.     {
  63.         $this->student $student;
  64.         return $this;
  65.     }
  66.     public function getClasse(): ?TheClass
  67.     {
  68.         return $this->classe;
  69.     }
  70.     public function setClasse(?TheClass $classe): static
  71.     {
  72.         $this->classe $classe;
  73.         return $this;
  74.     }
  75.     public function getEvaluation(): ?PrimaryEvaluation
  76.     {
  77.         return $this->evaluation;
  78.     }
  79.     public function setEvaluation(?PrimaryEvaluation $evaluation): static
  80.     {
  81.         $this->evaluation $evaluation;
  82.         return $this;
  83.     }
  84.     public function getQuarter(): ?Quarter
  85.     {
  86.         return $this->evaluation?->getQuarter();
  87.     }
  88.     public function getStartAt(): ?\DateTimeInterface
  89.     {
  90.         return $this->startAt;
  91.     }
  92.     public function setStartAt(\DateTimeInterface $startAt): static
  93.     {
  94.         $this->startAt $startAt;
  95.         return $this;
  96.     }
  97.     public function getEndAt(): ?\DateTimeInterface
  98.     {
  99.         return $this->endAt;
  100.     }
  101.     public function setEndAt(\DateTimeInterface $endAt): static
  102.     {
  103.         $this->endAt $endAt;
  104.         return $this;
  105.     }
  106.     public function isJustified(): bool
  107.     {
  108.         return $this->justified;
  109.     }
  110.     public function setJustified(bool $justified): static
  111.     {
  112.         $this->justified $justified;
  113.         return $this;
  114.     }
  115.     public function getMotif(): ?string
  116.     {
  117.         return $this->motif;
  118.     }
  119.     public function setMotif(?string $motif): static
  120.     {
  121.         $this->motif $motif;
  122.         return $this;
  123.     }
  124.     public function getSchool(): ?School
  125.     {
  126.         return $this->school;
  127.     }
  128.     public function setSchool(?School $school): static
  129.     {
  130.         $this->school $school;
  131.         return $this;
  132.     }
  133.     public function getYear(): ?SchoolYear
  134.     {
  135.         return $this->year;
  136.     }
  137.     public function setYear(?SchoolYear $year): static
  138.     {
  139.         $this->year $year;
  140.         return $this;
  141.     }
  142.     public function getAuthor(): ?User
  143.     {
  144.         return $this->author;
  145.     }
  146.     public function setAuthor(?User $author): static
  147.     {
  148.         $this->author $author;
  149.         return $this;
  150.     }
  151. }