src/Entity/Note.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\Timestampable;
  4. use App\Repository\NoteRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use JMS\Serializer\Annotation\Groups;
  9. #[ORM\HasLifecycleCallbacks]
  10. #[ORM\Entity(repositoryClassNoteRepository::class)]
  11. class Note
  12. {
  13.     use Timestampable;
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     #[Groups(['note','getBulletin'])]
  18.     private ?int $id null;
  19.     #[ORM\Column]
  20.     #[Groups(['note','getBulletin'])]
  21.     private ?float $note null;
  22.     #[ORM\Column]
  23.     #[Groups(['note','getBulletin'])]
  24.     private ?float $noteCoef null;
  25.     #[ORM\ManyToOne(inversedBy'notes'cascade: ["persist"])]
  26.     #[Groups(['note'])]
  27.     private ?Student $student null;
  28.     #[ORM\ManyToOne(inversedBy'notes'cascade: ["persist"])]
  29.     #[Groups(['note'])]
  30.     private ?Exams $exams null;
  31.     #[ORM\ManyToOne(inversedBy'notes'cascade: ["persist"])]
  32.     #[Groups(['note'])]
  33.     private ?TheClass $classe null;
  34.     #[ORM\ManyToOne(inversedBy'notes'cascade: ["persist"])]
  35.     #[ORM\JoinColumn(nullablefalse)]
  36.     #[Groups(['note','getBulletin'])]
  37.     private ?Subject $subject null;
  38.     #[ORM\ManyToOne(inversedBy'notes'cascade: ["persist"])]
  39.     #[ORM\JoinColumn(nullablefalse)]
  40.     private ?SchoolYear $year null;
  41.     #[ORM\Column(length255nullabletrue)]
  42.     #[Groups(['note'])]
  43.     private ?string $examName null;
  44.     #[ORM\ManyToOne(inversedBy'notes'cascade: ["persist"])]
  45.     #[ORM\JoinColumn(nullablefalse)]
  46.     private ?User $author null;
  47.     #[ORM\ManyToOne(inversedBy'notesEdited'cascade: ["persist"])]
  48.     private ?User $editor null;
  49.     #[ORM\ManyToOne(inversedBy'notes'cascade: ["persist"])]
  50.     private ?School $school null;
  51.     #[ORM\ManyToOne(inversedBy'notes')]
  52.     private ?SubSequence $subSequence null;
  53.     #[ORM\Column(length255nullabletrue)]
  54.     #[Groups(['note'])]
  55.     private ?string $name null;
  56.     #[ORM\ManyToOne(inversedBy'note')]
  57.     #[Groups(['note'])]
  58.     private ?ParentNote $parentNote null;
  59.     #[ORM\Column(nullabletrue)]
  60.     private ?int $division null;
  61.     #[ORM\Column(nullabletrue)]
  62.     #[Groups(['note'])]
  63.     private ?int $dividend null;
  64.     #[ORM\OneToMany(mappedBy'parent'targetEntitySubNote::class)]
  65.     private Collection $subNotes;
  66.     #[ORM\Column(nullabletrue)]
  67.     private ?float $coef null;
  68.     public function __construct()
  69.     {
  70.         $this->subNotes = new ArrayCollection();
  71.     }
  72.     public function getId(): ?int
  73.     {
  74.         return $this->id;
  75.     }
  76.     public function getNote(): ?float
  77.     {
  78.         return $this->note;
  79.     }
  80.     public function setNote(float $note): static
  81.     {
  82.         $this->note $note;
  83.         return $this;
  84.     }
  85.     public function getNoteCoef(): ?float
  86.     {
  87.         return $this->noteCoef;
  88.     }
  89.     public function setNoteCoef(float $noteCoef): static
  90.     {
  91.         $this->noteCoef $noteCoef;
  92.         return $this;
  93.     }
  94.     public function getStudent(): ?Student
  95.     {
  96.         return $this->student;
  97.     }
  98.     public function setStudent(?Student $student): static
  99.     {
  100.         $this->student $student;
  101.         return $this;
  102.     }
  103.     public function getExams(): ?Exams
  104.     {
  105.         return $this->exams;
  106.     }
  107.     public function setExams(?Exams $exams): static
  108.     {
  109.         $this->exams $exams;
  110.         return $this;
  111.     }
  112.     public function getClasse(): ?TheClass
  113.     {
  114.         return $this->classe;
  115.     }
  116.     public function setClasse(?TheClass $classe): static
  117.     {
  118.         $this->classe $classe;
  119.         return $this;
  120.     }
  121.     public function getSubject(): ?Subject
  122.     {
  123.         return $this->subject;
  124.     }
  125.     public function setSubject(?Subject $subject): static
  126.     {
  127.         $this->subject $subject;
  128.         return $this;
  129.     }
  130.     public function getYear(): ?SchoolYear
  131.     {
  132.         return $this->year;
  133.     }
  134.     public function setYear(?SchoolYear $year): static
  135.     {
  136.         $this->year $year;
  137.         return $this;
  138.     }
  139.     public function getExamName(): ?string
  140.     {
  141.         return $this->examName;
  142.     }
  143.     public function setExamName(?string $examName): static
  144.     {
  145.         $this->examName $examName;
  146.         return $this;
  147.     }
  148.     public function getRelation(): ?string
  149.     {
  150.         return $this->relation;
  151.     }
  152.     public function setRelation(string $relation): static
  153.     {
  154.         $this->relation $relation;
  155.         return $this;
  156.     }
  157.     public function getAuthor(): ?User
  158.     {
  159.         return $this->author;
  160.     }
  161.     public function setAuthor(?User $author): static
  162.     {
  163.         $this->author $author;
  164.         return $this;
  165.     }
  166.     public function getEditor(): ?User
  167.     {
  168.         return $this->editor;
  169.     }
  170.     public function setEditor(?User $editor): static
  171.     {
  172.         $this->editor $editor;
  173.         return $this;
  174.     }
  175.     public function getSchool(): ?School
  176.     {
  177.         return $this->school;
  178.     }
  179.     public function setSchool(?School $school): static
  180.     {
  181.         $this->school $school;
  182.         return $this;
  183.     }
  184.     public function getSubSequence(): ?SubSequence
  185.     {
  186.         return $this->subSequence;
  187.     }
  188.     public function setSubSequence(?SubSequence $subSequence): static
  189.     {
  190.         $this->subSequence $subSequence;
  191.         return $this;
  192.     }
  193.     public function getName(): ?string
  194.     {
  195.         return $this->name;
  196.     }
  197.     public function setName(?string $name): static
  198.     {
  199.         $this->name $name;
  200.         return $this;
  201.     }
  202.     /**
  203.      * @return Collection<int, SubNote>
  204.      */
  205.     public function getSubNotes(): Collection
  206.     {
  207.         return $this->subNotes;
  208.     }
  209.     public function addSubNote(SubNote $subNote): static
  210.     {
  211.         if (!$this->subNotes->contains($subNote)) {
  212.             $this->subNotes->add($subNote);
  213.             $subNote->setParent($this);
  214.         }
  215.         return $this;
  216.     }
  217.     public function getParentNote(): ?ParentNote
  218.     {
  219.         return $this->parentNote;
  220.     }
  221.     public function setParentNote(?ParentNote $parentNote): static
  222.     {
  223.         $this->parentNote $parentNote;
  224.         return $this;
  225.     }
  226.     public function getDivision(): ?int
  227.     {
  228.         return $this->division;
  229.     }
  230.     public function setDivision(?int $division): static
  231.     {
  232.         $this->division $division;
  233.         return $this;
  234.     }
  235.     public function getDividend(): ?int
  236.     {
  237.         return $this->dividend;
  238.     }
  239.     public function setDividend(?int $dividend): static
  240.     {
  241.         $this->dividend $dividend;
  242.         return $this;
  243.     }
  244.     public function removeSubNote(SubNote $subNote): static
  245.     {
  246.         if ($this->subNotes->removeElement($subNote)) {
  247.             // set the owning side to null (unless already changed)
  248.             if ($subNote->getParent() === $this) {
  249.                 $subNote->setParent(null);
  250.             }
  251.         }
  252.         return $this;
  253.     }
  254.     public function getCoef(): ?float
  255.     {
  256.         return $this->coef;
  257.     }
  258.     public function setCoef(?float $coef): static
  259.     {
  260.         $this->coef $coef;
  261.         return $this;
  262.     }
  263. }