<?php
namespace App\Entity;
use App\Repository\VerbalProcessCategoryRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: VerbalProcessCategoryRepository::class)]
class VerbalProcessCategory
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\ManyToOne(inversedBy: 'verbalProcessCategories')]
#[ORM\JoinColumn(nullable: false)]
private ?School $school = null;
#[ORM\ManyToOne(inversedBy: 'verbalProcessCategories')]
#[ORM\JoinColumn(nullable: false)]
private ?SchoolYear $year = null;
#[ORM\ManyToOne(inversedBy: 'verbalProcessCategories')]
#[ORM\JoinColumn(nullable: false)]
private ?User $author = null;
#[ORM\OneToMany(mappedBy: 'verbalProcessCategory', targetEntity: VerbalProcess::class)]
private Collection $verbalProcess;
public function __construct()
{
$this->verbalProcess = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getSchool(): ?School
{
return $this->school;
}
public function setSchool(?School $school): static
{
$this->school = $school;
return $this;
}
public function getYear(): ?SchoolYear
{
return $this->year;
}
public function setYear(?SchoolYear $year): static
{
$this->year = $year;
return $this;
}
public function getAuthor(): ?User
{
return $this->author;
}
public function setAuthor(?User $author): static
{
$this->author = $author;
return $this;
}
/**
* @return Collection<int, VerbalProcess>
*/
public function getVerbalProcess(): Collection
{
return $this->verbalProcess;
}
public function addVerbalProcess(VerbalProcess $verbalProcess): static
{
if (!$this->verbalProcess->contains($verbalProcess)) {
$this->verbalProcess->add($verbalProcess);
$verbalProcess->setVerbalProcessCategory($this);
}
return $this;
}
public function removeVerbalProcess(VerbalProcess $verbalProcess): static
{
if ($this->verbalProcess->removeElement($verbalProcess)) {
// set the owning side to null (unless already changed)
if ($verbalProcess->getVerbalProcessCategory() === $this) {
$verbalProcess->setVerbalProcessCategory(null);
}
}
return $this;
}
}