src/Entity/SubSequence.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\Timestampable;
  4. use App\Repository\SubSequenceRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\HasLifecycleCallbacks]
  9. #[ORM\Entity(repositoryClassSubSequenceRepository::class)]
  10. class SubSequence
  11. {
  12.     use Timestampable;
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     #[Groups(['note'])]
  17.     private ?int $id null;
  18.     #[ORM\Column(length255)]
  19.     #[Groups(['note'])]
  20.     private ?string $name null;
  21.     #[ORM\Column]
  22.     #[Groups(['note'])]
  23.     private ?float $percentage null;
  24.     #[ORM\OneToMany(mappedBy'subSequence'targetEntityNote::class)]
  25.     private Collection $notes;
  26.     #[ORM\ManyToOne(inversedBy'subSequences')]
  27.     #[ORM\JoinColumn(nullablefalse)]
  28.     #[Groups(['note'])]
  29.     private ?Exams $exam null;
  30.     #[ORM\ManyToOne(inversedBy'subSequences')]
  31.     #[ORM\JoinColumn(nullablefalse)]
  32.     private ?User $author null;
  33.     #[ORM\ManyToOne(inversedBy'subSequences')]
  34.     #[ORM\JoinColumn(nullablefalse)]
  35.     private ?TheClass $classe null;
  36.     #[ORM\ManyToOne(inversedBy'subSequences')]
  37.     #[ORM\JoinColumn(nullablefalse)]
  38.     private ?School $School null;
  39.     public function __construct()
  40.     {
  41.         $this->notes = new ArrayCollection();
  42.     }
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getName(): ?string
  48.     {
  49.         return $this->name;
  50.     }
  51.     public function setName(string $name): static
  52.     {
  53.         $this->name $name;
  54.         return $this;
  55.     }
  56.     public function getPercentage(): ?float
  57.     {
  58.         return $this->percentage;
  59.     }
  60.     public function setPercentage(float $percentage): static
  61.     {
  62.         $this->percentage $percentage;
  63.         return $this;
  64.     }
  65.     /**
  66.      * @return Collection<int, Note>
  67.      */
  68.     public function getNotes(): Collection
  69.     {
  70.         return $this->notes;
  71.     }
  72.     public function addNote(Note $note): static
  73.     {
  74.         if (!$this->notes->contains($note)) {
  75.             $this->notes->add($note);
  76.             $note->setSubSequence($this);
  77.         }
  78.         return $this;
  79.     }
  80.     public function removeNote(Note $note): static
  81.     {
  82.         if ($this->notes->removeElement($note)) {
  83.             // set the owning side to null (unless already changed)
  84.             if ($note->getSubSequence() === $this) {
  85.                 $note->setSubSequence(null);
  86.             }
  87.         }
  88.         return $this;
  89.     }
  90.     public function getExam(): ?Exams
  91.     {
  92.         return $this->exam;
  93.     }
  94.     public function setExam(?Exams $exam): static
  95.     {
  96.         $this->exam $exam;
  97.         return $this;
  98.     }
  99.     public function getAuthor(): ?User
  100.     {
  101.         return $this->author;
  102.     }
  103.     public function setAuthor(?User $author): static
  104.     {
  105.         $this->author $author;
  106.         return $this;
  107.     }
  108.     public function getClasse(): ?TheClass
  109.     {
  110.         return $this->classe;
  111.     }
  112.     public function setClasse(?TheClass $classe): static
  113.     {
  114.         $this->classe $classe;
  115.         return $this;
  116.     }
  117.     public function getSchool(): ?School
  118.     {
  119.         return $this->School;
  120.     }
  121.     public function setSchool(?School $School): static
  122.     {
  123.         $this->School $School;
  124.         return $this;
  125.     }
  126. }