<?phpnamespace App\Entity;use App\Repository\ProjectStatusRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=ProjectStatusRepository::class) */class ProjectStatus{ /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=64) */ private $name; /** * @ORM\Column(type="string", length=64, nullable=true) */ private $color; /** * @ORM\OneToMany(targetEntity=WorkerInProject::class, mappedBy="status") */ private $workerInProjects; public function __construct() { $this->workerInProjects = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getColor(): ?string { return $this->color; } public function setColor(?string $color): self { $this->color = $color; return $this; } /** * @return Collection<int, WorkerInProject> */ public function getWorkerInProjects(): Collection { return $this->workerInProjects; } public function addWorkerInProject(WorkerInProject $workerInProject): self { if (!$this->workerInProjects->contains($workerInProject)) { $this->workerInProjects[] = $workerInProject; $workerInProject->setStatus($this); } return $this; } public function removeWorkerInProject(WorkerInProject $workerInProject): self { if ($this->workerInProjects->removeElement($workerInProject)) { // set the owning side to null (unless already changed) if ($workerInProject->getStatus() === $this) { $workerInProject->setStatus(null); } } return $this; }}