src/Entity/StudentSubjectExemption.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\Timestampable;
  4. use App\Repository\StudentSubjectExemptionRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * Dispense d'un élève pour une matière, pour toute l'année scolaire (portée
  8.  * = son inscription StudentYear, donc classe + année). Tant qu'une ligne
  9.  * existe pour (studentYear, subject), cet élève est traité comme "n'ayant
  10.  * pas composé" cette matière partout (bulletin, stats, classement, saisie
  11.  * de notes) — même mécanisme que l'absence de Note pour une séquence, mais
  12.  * appliqué à l'année entière. Les Note déjà saisies ne sont jamais
  13.  * supprimées : seulement ignorées tant que la dispense est active.
  14.  */
  15. #[ORM\HasLifecycleCallbacks]
  16. #[ORM\Entity(repositoryClassStudentSubjectExemptionRepository::class)]
  17. #[ORM\UniqueConstraint(columns: ['student_year_id''subject_id'])]
  18. class StudentSubjectExemption
  19. {
  20.     use Timestampable;
  21.     #[ORM\Id]
  22.     #[ORM\GeneratedValue]
  23.     #[ORM\Column]
  24.     private ?int $id null;
  25.     #[ORM\ManyToOne(inversedBy'subjectExemptions')]
  26.     #[ORM\JoinColumn(nullablefalse)]
  27.     private ?StudentYear $studentYear null;
  28.     #[ORM\ManyToOne]
  29.     #[ORM\JoinColumn(nullablefalse)]
  30.     private ?Subject $subject null;
  31.     #[ORM\ManyToOne]
  32.     private ?User $author null;
  33.     public function getId(): ?int
  34.     {
  35.         return $this->id;
  36.     }
  37.     public function getStudentYear(): ?StudentYear
  38.     {
  39.         return $this->studentYear;
  40.     }
  41.     public function setStudentYear(?StudentYear $studentYear): static
  42.     {
  43.         $this->studentYear $studentYear;
  44.         return $this;
  45.     }
  46.     public function getSubject(): ?Subject
  47.     {
  48.         return $this->subject;
  49.     }
  50.     public function setSubject(?Subject $subject): static
  51.     {
  52.         $this->subject $subject;
  53.         return $this;
  54.     }
  55.     public function getAuthor(): ?User
  56.     {
  57.         return $this->author;
  58.     }
  59.     public function setAuthor(?User $author): static
  60.     {
  61.         $this->author $author;
  62.         return $this;
  63.     }
  64. }