src/Entity/VerbalProcessCategory.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\VerbalProcessCategoryRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassVerbalProcessCategoryRepository::class)]
  8. class VerbalProcessCategory
  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\ManyToOne(inversedBy'verbalProcessCategories')]
  17.     #[ORM\JoinColumn(nullablefalse)]
  18.     private ?School $school null;
  19.     #[ORM\ManyToOne(inversedBy'verbalProcessCategories')]
  20.     #[ORM\JoinColumn(nullablefalse)]
  21.     private ?SchoolYear $year null;
  22.     #[ORM\ManyToOne(inversedBy'verbalProcessCategories')]
  23.     #[ORM\JoinColumn(nullablefalse)]
  24.     private ?User $author null;
  25.     #[ORM\OneToMany(mappedBy'verbalProcessCategory'targetEntityVerbalProcess::class)]
  26.     private Collection $verbalProcess;
  27.     public function __construct()
  28.     {
  29.         $this->verbalProcess = new ArrayCollection();
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getName(): ?string
  36.     {
  37.         return $this->name;
  38.     }
  39.     public function setName(string $name): static
  40.     {
  41.         $this->name $name;
  42.         return $this;
  43.     }
  44.     public function getSchool(): ?School
  45.     {
  46.         return $this->school;
  47.     }
  48.     public function setSchool(?School $school): static
  49.     {
  50.         $this->school $school;
  51.         return $this;
  52.     }
  53.     public function getYear(): ?SchoolYear
  54.     {
  55.         return $this->year;
  56.     }
  57.     public function setYear(?SchoolYear $year): static
  58.     {
  59.         $this->year $year;
  60.         return $this;
  61.     }
  62.     public function getAuthor(): ?User
  63.     {
  64.         return $this->author;
  65.     }
  66.     public function setAuthor(?User $author): static
  67.     {
  68.         $this->author $author;
  69.         return $this;
  70.     }
  71.     /**
  72.      * @return Collection<int, VerbalProcess>
  73.      */
  74.     public function getVerbalProcess(): Collection
  75.     {
  76.         return $this->verbalProcess;
  77.     }
  78.     public function addVerbalProcess(VerbalProcess $verbalProcess): static
  79.     {
  80.         if (!$this->verbalProcess->contains($verbalProcess)) {
  81.             $this->verbalProcess->add($verbalProcess);
  82.             $verbalProcess->setVerbalProcessCategory($this);
  83.         }
  84.         return $this;
  85.     }
  86.     public function removeVerbalProcess(VerbalProcess $verbalProcess): static
  87.     {
  88.         if ($this->verbalProcess->removeElement($verbalProcess)) {
  89.             // set the owning side to null (unless already changed)
  90.             if ($verbalProcess->getVerbalProcessCategory() === $this) {
  91.                 $verbalProcess->setVerbalProcessCategory(null);
  92.             }
  93.         }
  94.         return $this;
  95.     }
  96. }