src/Entity/PrimaryParentNote.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PrimaryParentNoteRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassPrimaryParentNoteRepository::class)]
  8. class PrimaryParentNote
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column]
  13.     private ?int $id null;
  14.     #[ORM\Column(length255)]
  15.     private ?string $name null;
  16.     #[ORM\Column]
  17.     private ?float $point null;
  18.     #[ORM\OneToOne(inversedBy'primaryParentNote'cascade: ['persist''remove'])]
  19.     #[ORM\JoinColumn(nullablefalse)]
  20.     private ?Subject $subject null;
  21.     #[ORM\ManyToOne(inversedBy'primaryParentNotes')]
  22.     #[ORM\JoinColumn(nullablefalse)]
  23.     private ?School $school null;
  24.     #[ORM\ManyToOne(inversedBy'primaryParentNotes')]
  25.     #[ORM\JoinColumn(nullablefalse)]
  26.     private ?SchoolYear $year null;
  27.     #[ORM\ManyToOne(inversedBy'primaryParentNotes')]
  28.     #[ORM\JoinColumn(nullablefalse)]
  29.     private ?TheClass $classe null;
  30.     #[ORM\OneToMany(mappedBy'parentNote'targetEntityPrimaryNote::class)]
  31.     private Collection $primaryNotes;
  32.     public function __construct()
  33.     {
  34.         $this->primaryNotes = new ArrayCollection();
  35.     }
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function getName(): ?string
  41.     {
  42.         return $this->name;
  43.     }
  44.     public function setName(string $name): static
  45.     {
  46.         $this->name $name;
  47.         return $this;
  48.     }
  49.     public function getPoint(): ?float
  50.     {
  51.         return $this->point;
  52.     }
  53.     public function setPoint(float $point): static
  54.     {
  55.         $this->point $point;
  56.         return $this;
  57.     }
  58.     public function getSubject(): ?Subject
  59.     {
  60.         return $this->subject;
  61.     }
  62.     public function setSubject(Subject $subject): static
  63.     {
  64.         $this->subject $subject;
  65.         return $this;
  66.     }
  67.     public function getSchool(): ?School
  68.     {
  69.         return $this->school;
  70.     }
  71.     public function setSchool(?School $school): static
  72.     {
  73.         $this->school $school;
  74.         return $this;
  75.     }
  76.     public function getYear(): ?SchoolYear
  77.     {
  78.         return $this->year;
  79.     }
  80.     public function setYear(?SchoolYear $year): static
  81.     {
  82.         $this->year $year;
  83.         return $this;
  84.     }
  85.     public function getClasse(): ?TheClass
  86.     {
  87.         return $this->classe;
  88.     }
  89.     public function setClasse(?TheClass $classe): static
  90.     {
  91.         $this->classe $classe;
  92.         return $this;
  93.     }
  94.     /**
  95.      * @return Collection<int, PrimaryNote>
  96.      */
  97.     public function getPrimaryNotes(): Collection
  98.     {
  99.         return $this->primaryNotes;
  100.     }
  101.     public function addPrimaryNote(PrimaryNote $primaryNote): static
  102.     {
  103.         if (!$this->primaryNotes->contains($primaryNote)) {
  104.             $this->primaryNotes->add($primaryNote);
  105.             $primaryNote->setParentNote($this);
  106.         }
  107.         return $this;
  108.     }
  109.     public function removePrimaryNote(PrimaryNote $primaryNote): static
  110.     {
  111.         if ($this->primaryNotes->removeElement($primaryNote)) {
  112.             // set the owning side to null (unless already changed)
  113.             if ($primaryNote->getParentNote() === $this) {
  114.                 $primaryNote->setParentNote(null);
  115.             }
  116.         }
  117.         return $this;
  118.     }
  119. }