<?phpnamespace App\Entity;use App\Repository\ProjectClassifyRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;/** * @ORM\Entity(repositoryClass=ProjectClassifyRepository::class) */class ProjectClassify{ /** * @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=Projects::class, mappedBy="classify") */ private $projects; public function __construct() { $this->projects = 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, Projects> */ public function getProjects(): Collection { return $this->projects; } public function addProject(Projects $project): self { if (!$this->projects->contains($project)) { $this->projects[] = $project; $project->setClassify($this); } return $this; } public function removeProject(Projects $project): self { if ($this->projects->removeElement($project)) { // set the owning side to null (unless already changed) if ($project->getClassify() === $this) { $project->setClassify(null); } } return $this; }}