src/Entity/LearningCompetency.php line 23

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\Timestampable;
  4. use App\Repository\LearningCompetencyRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. // Compétence du module Apprentissage — INDÉPENDANTE du système de notation
  7. // par compétence existant (App\Entity\Competence, obligatoirement rattaché à
  8. // un Quarter OU un Exams). Rattachée à UNE leçon/TD du cahier de texte
  9. // (SubjectLesson) précise, pas directement à la matière : un simple libellé
  10. // de savoir-faire ("Reconnaître une fraction") propre à cette leçon,
  11. // évaluable par toutes les Activity de TOUTES les capsules qui digitalisent
  12. // cette même leçon (voir Capsule::$subjectLesson). Une capsule "libre" (sans
  13. // SubjectLesson) ne peut donc pas se voir associer de compétence — c'est
  14. // voulu : la compétence est un attribut du point de programme, pas de la
  15. // capsule. La "note" existe seulement en creux, via l'historique des
  16. // StudentActivityAttempt des activités qui la référencent (voir
  17. // StudentActivityAttemptRepository::findByStudentAndCompetency).
  18. #[ORM\HasLifecycleCallbacks]
  19. #[ORM\Entity(repositoryClassLearningCompetencyRepository::class)]
  20. class LearningCompetency
  21. {
  22.     use Timestampable;
  23.     #[ORM\Id]
  24.     #[ORM\GeneratedValue]
  25.     #[ORM\Column]
  26.     private ?int $id null;
  27.     #[ORM\ManyToOne(inversedBy'learningCompetencies')]
  28.     #[ORM\JoinColumn(nullablefalseonDelete'CASCADE')]
  29.     private ?SubjectLesson $subjectLesson null;
  30.     #[ORM\Column(length255)]
  31.     private ?string $name null;
  32.     #[ORM\Column(type'text'nullabletrue)]
  33.     private ?string $description null;
  34.     #[ORM\Column]
  35.     private int $position 0;
  36.     #[ORM\ManyToOne]
  37.     #[ORM\JoinColumn(nullablefalse)]
  38.     private ?User $author null;
  39.     #[ORM\ManyToOne]
  40.     private ?User $editor null;
  41.     public function __toString(): string
  42.     {
  43.         return $this->name ?? '';
  44.     }
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     public function getSubjectLesson(): ?SubjectLesson
  50.     {
  51.         return $this->subjectLesson;
  52.     }
  53.     public function setSubjectLesson(?SubjectLesson $subjectLesson): static
  54.     {
  55.         $this->subjectLesson $subjectLesson;
  56.         return $this;
  57.     }
  58.     public function getName(): ?string
  59.     {
  60.         return $this->name;
  61.     }
  62.     public function setName(string $name): static
  63.     {
  64.         $this->name $name;
  65.         return $this;
  66.     }
  67.     public function getDescription(): ?string
  68.     {
  69.         return $this->description;
  70.     }
  71.     public function setDescription(?string $description): static
  72.     {
  73.         $this->description $description;
  74.         return $this;
  75.     }
  76.     public function getPosition(): int
  77.     {
  78.         return $this->position;
  79.     }
  80.     public function setPosition(int $position): static
  81.     {
  82.         $this->position $position;
  83.         return $this;
  84.     }
  85.     public function getAuthor(): ?User
  86.     {
  87.         return $this->author;
  88.     }
  89.     public function setAuthor(?User $author): static
  90.     {
  91.         $this->author $author;
  92.         return $this;
  93.     }
  94.     public function getEditor(): ?User
  95.     {
  96.         return $this->editor;
  97.     }
  98.     public function setEditor(?User $editor): static
  99.     {
  100.         $this->editor $editor;
  101.         return $this;
  102.     }
  103. }