<?phpnamespace App\Entity;use App\Entity\Traits\Timestampable;use App\Repository\DailyAbsenceRepository;use Doctrine\ORM\Mapping as ORM;// Absence journalière — écoles primaires/maternelles uniquement. L'appel s'y// fait une fois par jour pour toute la classe (pas par matière/période comme// au secondaire, voir Absence.php qui reste lié à AgendaElement/Exams et// n'est pas touché). startAt/endAt sont des DATETIME (pas juste une heure ou// une date) pour permettre un intervalle explicite sur plusieurs jours (ex:// absent de mardi 14h à jeudi 10h), en plus du cas simple "absent toute la// journée" (startAt = jour 00:00, endAt = jour 23:59:59). Entité neuve et// isolée : aucun rapport avec Absence/AgendaElement/Exams existants.#[ORM\HasLifecycleCallbacks]#[ORM\Entity(repositoryClass: DailyAbsenceRepository::class)]class DailyAbsence{ use Timestampable; #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\ManyToOne] #[ORM\JoinColumn(nullable: false)] private ?Student $student = null; #[ORM\ManyToOne] #[ORM\JoinColumn(nullable: false)] private ?TheClass $classe = null; // Primaire/maternelle : absence rattachée à l'évaluation mensuelle (pas de // séquence dans ce système), choisie explicitement par l'utilisateur au // même titre que pour la saisie des notes (voir PrimaryComponentNote et // PrimaryEvaluation). Le trimestre est accessible via getQuarter(). #[ORM\ManyToOne] #[ORM\JoinColumn(nullable: false)] private ?PrimaryEvaluation $evaluation = null; #[ORM\Column] private ?\DateTimeInterface $startAt = null; #[ORM\Column] private ?\DateTimeInterface $endAt = null; #[ORM\Column] private bool $justified = false; #[ORM\Column(length: 255, nullable: true)] private ?string $motif = null; #[ORM\ManyToOne] #[ORM\JoinColumn(nullable: false)] private ?School $school = null; #[ORM\ManyToOne] #[ORM\JoinColumn(nullable: false)] private ?SchoolYear $year = null; #[ORM\ManyToOne] #[ORM\JoinColumn(nullable: false)] private ?User $author = null; public function getId(): ?int { return $this->id; } public function getStudent(): ?Student { return $this->student; } public function setStudent(?Student $student): static { $this->student = $student; return $this; } public function getClasse(): ?TheClass { return $this->classe; } public function setClasse(?TheClass $classe): static { $this->classe = $classe; return $this; } public function getEvaluation(): ?PrimaryEvaluation { return $this->evaluation; } public function setEvaluation(?PrimaryEvaluation $evaluation): static { $this->evaluation = $evaluation; return $this; } public function getQuarter(): ?Quarter { return $this->evaluation?->getQuarter(); } public function getStartAt(): ?\DateTimeInterface { return $this->startAt; } public function setStartAt(\DateTimeInterface $startAt): static { $this->startAt = $startAt; return $this; } public function getEndAt(): ?\DateTimeInterface { return $this->endAt; } public function setEndAt(\DateTimeInterface $endAt): static { $this->endAt = $endAt; return $this; } public function isJustified(): bool { return $this->justified; } public function setJustified(bool $justified): static { $this->justified = $justified; return $this; } public function getMotif(): ?string { return $this->motif; } public function setMotif(?string $motif): static { $this->motif = $motif; return $this; } public function getSchool(): ?School { return $this->school; } public function setSchool(?School $school): static { $this->school = $school; return $this; } public function getYear(): ?SchoolYear { return $this->year; } public function setYear(?SchoolYear $year): static { $this->year = $year; return $this; } public function getAuthor(): ?User { return $this->author; } public function setAuthor(?User $author): static { $this->author = $author; return $this; }}