src/Entity/PrimaryEvaluationReference.php line 28

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\Timestampable;
  4. use App\Repository\PrimaryEvaluationReferenceRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * Évaluation mensuelle du calendrier national (créée par le super-admin) —
  8.  * écoles primaires/maternelles. Joue le rôle qu'Exams (séquence) joue côté
  9.  * secondaire : jusqu'à 3 par trimestre (2 pour le 3e). `quarterNumber` (1-3)
  10.  * situe l'évaluation dans l'année scolaire de façon abstraite — au moment de
  11.  * la copie vers une école (voir PrimaryEvaluationCopier), converti en Quarter
  12.  * réel de la même façon que CompetenceReference::quarterNumber.
  13.  *
  14.  * `name`/`nameEn` sont un intitulé interne/administratif ; `evaluationName`/
  15.  * `evaluationNameEn` sont le libellé qui apparaît sur le bulletin — les deux
  16.  * sont définis par le super-admin et peuvent différer (ex: name="Mois 1",
  17.  * evaluationName="1ère Évaluation" ou toute autre convention de l'école).
  18.  * `startAt`/`endAt` sont purement informatifs (aucune validation de saisie).
  19.  *
  20.  * Scopée par SchoolYear (contrairement à CompetenceReference, réutilisable
  21.  * indéfiniment) car les dates sont propres au calendrier d'une année donnée.
  22.  */
  23. #[ORM\HasLifecycleCallbacks]
  24. #[ORM\Entity(repositoryClassPrimaryEvaluationReferenceRepository::class)]
  25. class PrimaryEvaluationReference
  26. {
  27.     use Timestampable;
  28.     #[ORM\Id]
  29.     #[ORM\GeneratedValue]
  30.     #[ORM\Column]
  31.     private ?int $id null;
  32.     #[ORM\ManyToOne]
  33.     #[ORM\JoinColumn(nullablefalse)]
  34.     private ?SchoolYear $year null;
  35.     #[ORM\Column]
  36.     private ?int $quarterNumber null;
  37.     /**
  38.      * Ordre au sein du trimestre (1..3, ou 1..2 pour un trimestre à 2
  39.      * évaluations — le super-admin ne crée simplement pas de 3e position).
  40.      */
  41.     #[ORM\Column]
  42.     private ?int $position null;
  43.     #[ORM\Column(length255)]
  44.     private ?string $name null;
  45.     #[ORM\Column(length255nullabletrue)]
  46.     private ?string $nameEn null;
  47.     #[ORM\Column(length255)]
  48.     private ?string $evaluationName null;
  49.     #[ORM\Column(length255nullabletrue)]
  50.     private ?string $evaluationNameEn null;
  51.     #[ORM\Column(type'date'nullabletrue)]
  52.     private ?\DateTimeInterface $startAt null;
  53.     #[ORM\Column(type'date'nullabletrue)]
  54.     private ?\DateTimeInterface $endAt null;
  55.     #[ORM\ManyToOne]
  56.     private ?User $author null;
  57.     public function __toString(): string
  58.     {
  59.         return $this->name ?? '';
  60.     }
  61.     public function getId(): ?int
  62.     {
  63.         return $this->id;
  64.     }
  65.     public function getYear(): ?SchoolYear
  66.     {
  67.         return $this->year;
  68.     }
  69.     public function setYear(?SchoolYear $year): static
  70.     {
  71.         $this->year $year;
  72.         return $this;
  73.     }
  74.     public function getQuarterNumber(): ?int
  75.     {
  76.         return $this->quarterNumber;
  77.     }
  78.     public function setQuarterNumber(int $quarterNumber): static
  79.     {
  80.         $this->quarterNumber $quarterNumber;
  81.         return $this;
  82.     }
  83.     public function getPosition(): ?int
  84.     {
  85.         return $this->position;
  86.     }
  87.     public function setPosition(int $position): static
  88.     {
  89.         $this->position $position;
  90.         return $this;
  91.     }
  92.     public function getName(): ?string
  93.     {
  94.         return $this->name;
  95.     }
  96.     public function setName(string $name): static
  97.     {
  98.         $this->name $name;
  99.         return $this;
  100.     }
  101.     public function getNameEn(): ?string
  102.     {
  103.         return $this->nameEn;
  104.     }
  105.     public function setNameEn(?string $nameEn): static
  106.     {
  107.         $this->nameEn $nameEn;
  108.         return $this;
  109.     }
  110.     public function getEvaluationName(): ?string
  111.     {
  112.         return $this->evaluationName;
  113.     }
  114.     public function setEvaluationName(string $evaluationName): static
  115.     {
  116.         $this->evaluationName $evaluationName;
  117.         return $this;
  118.     }
  119.     public function getEvaluationNameEn(): ?string
  120.     {
  121.         return $this->evaluationNameEn;
  122.     }
  123.     public function setEvaluationNameEn(?string $evaluationNameEn): static
  124.     {
  125.         $this->evaluationNameEn $evaluationNameEn;
  126.         return $this;
  127.     }
  128.     public function getStartAt(): ?\DateTimeInterface
  129.     {
  130.         return $this->startAt;
  131.     }
  132.     public function setStartAt(?\DateTimeInterface $startAt): static
  133.     {
  134.         $this->startAt $startAt;
  135.         return $this;
  136.     }
  137.     public function getEndAt(): ?\DateTimeInterface
  138.     {
  139.         return $this->endAt;
  140.     }
  141.     public function setEndAt(?\DateTimeInterface $endAt): static
  142.     {
  143.         $this->endAt $endAt;
  144.         return $this;
  145.     }
  146.     public function getAuthor(): ?User
  147.     {
  148.         return $this->author;
  149.     }
  150.     public function setAuthor(?User $author): static
  151.     {
  152.         $this->author $author;
  153.         return $this;
  154.     }
  155. }