src/Entity/SubjectComponent.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\Timestampable;
  4. use App\Repository\SubjectComponentRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. // Sous-matière d'une matière d'école primaire/maternelle (Oral, Écrit, Pratique,
  7. // Attitude...), chacune avec son propre barème. La note de la matière = somme
  8. // des totaux de ses sous-matières (voir PrimaryNoteCalculator). Entité neuve et
  9. // isolée : n'a aucun rapport avec Note/Exams/Competence/SubNote existants.
  10. #[ORM\HasLifecycleCallbacks]
  11. #[ORM\Entity(repositoryClassSubjectComponentRepository::class)]
  12. class SubjectComponent
  13. {
  14.     use Timestampable;
  15.     #[ORM\Id]
  16.     #[ORM\GeneratedValue]
  17.     #[ORM\Column]
  18.     private ?int $id null;
  19.     #[ORM\ManyToOne]
  20.     #[ORM\JoinColumn(nullablefalse)]
  21.     private ?Subject $subject null;
  22.     // Trace la SubjectComponentReference nationale (super-admin) dont cette
  23.     // sous-matière a été copiée, pour permettre une synchronisation ultérieure
  24.     // sans écraser les personnalisations locales déjà faites par l'école — cf.
  25.     // Competence::$sourceCompetence pour le même patron.
  26.     #[ORM\ManyToOne]
  27.     private ?SubjectComponentReference $sourceComponent null;
  28.     #[ORM\Column(length255)]
  29.     private ?string $name null;
  30.     #[ORM\Column(length255nullabletrue)]
  31.     private ?string $nameEn null;
  32.     #[ORM\Column]
  33.     private ?float $maxMark null;
  34.     #[ORM\Column]
  35.     private int $position 0;
  36.     #[ORM\ManyToOne]
  37.     #[ORM\JoinColumn(nullablefalse)]
  38.     private ?School $school null;
  39.     #[ORM\ManyToOne]
  40.     #[ORM\JoinColumn(nullablefalse)]
  41.     private ?SchoolYear $year null;
  42.     #[ORM\ManyToOne]
  43.     #[ORM\JoinColumn(nullablefalse)]
  44.     private ?User $author null;
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     public function getSubject(): ?Subject
  50.     {
  51.         return $this->subject;
  52.     }
  53.     public function setSubject(?Subject $subject): static
  54.     {
  55.         $this->subject $subject;
  56.         return $this;
  57.     }
  58.     public function getSourceComponent(): ?SubjectComponentReference
  59.     {
  60.         return $this->sourceComponent;
  61.     }
  62.     public function setSourceComponent(?SubjectComponentReference $sourceComponent): static
  63.     {
  64.         $this->sourceComponent $sourceComponent;
  65.         return $this;
  66.     }
  67.     public function getName(): ?string
  68.     {
  69.         return $this->name;
  70.     }
  71.     public function setName(string $name): static
  72.     {
  73.         $this->name $name;
  74.         return $this;
  75.     }
  76.     public function getNameEn(): ?string
  77.     {
  78.         return $this->nameEn;
  79.     }
  80.     public function setNameEn(?string $nameEn): static
  81.     {
  82.         $this->nameEn $nameEn;
  83.         return $this;
  84.     }
  85.     public function getMaxMark(): ?float
  86.     {
  87.         return $this->maxMark;
  88.     }
  89.     public function setMaxMark(float $maxMark): static
  90.     {
  91.         $this->maxMark $maxMark;
  92.         return $this;
  93.     }
  94.     public function getPosition(): int
  95.     {
  96.         return $this->position;
  97.     }
  98.     public function setPosition(int $position): static
  99.     {
  100.         $this->position $position;
  101.         return $this;
  102.     }
  103.     public function getSchool(): ?School
  104.     {
  105.         return $this->school;
  106.     }
  107.     public function setSchool(?School $school): static
  108.     {
  109.         $this->school $school;
  110.         return $this;
  111.     }
  112.     public function getYear(): ?SchoolYear
  113.     {
  114.         return $this->year;
  115.     }
  116.     public function setYear(?SchoolYear $year): static
  117.     {
  118.         $this->year $year;
  119.         return $this;
  120.     }
  121.     public function getAuthor(): ?User
  122.     {
  123.         return $this->author;
  124.     }
  125.     public function setAuthor(?User $author): static
  126.     {
  127.         $this->author $author;
  128.         return $this;
  129.     }
  130. }