src/Entity/Tag.php line 11
<?phpnamespace 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 $tag_name = null;#[ORM\ManyToMany(targetEntity: Product::class, mappedBy: 'product_tags')]private Collection $tag_products;public function __construct(){$this->tag_products = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getTagName(): ?string{return $this->tag_name;}public function setTagName(string $tag_name): self{$this->tag_name = $tag_name;return $this;}/*** @return Collection<int, Product>*/public function getTagProducts(): Collection{return $this->tag_products;}public function addTagProduct(Product $tagProduct): self{if (!$this->tag_products->contains($tagProduct)) {$this->tag_products->add($tagProduct);$tagProduct->addProductTag($this);}return $this;}public function removeTagProduct(Product $tagProduct): self{if ($this->tag_products->removeElement($tagProduct)) {$tagProduct->removeProductTag($this);}return $this;}}