src/Entity/Tag.php line 11
<?php
namespace App\Entity;
use App\Repository\TagRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: TagRepository::class)]
class Tag
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $name = null;
#[ORM\ManyToMany(targetEntity: Project::class, inversedBy: 'tags')]
private Collection $Project;
public function __construct()
{
$this->Project = 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;
}
/**
* @return Collection<int, Project>
*/
public function getProject(): Collection
{
return $this->Project;
}
public function addProject(Project $project): self
{
if (!$this->Project->contains($project)) {
$this->Project->add($project);
}
return $this;
}
public function removeProject(Project $project): self
{
$this->Project->removeElement($project);
return $this;
}
}