*/ #[ORM\ManyToMany(targetEntity: Product::class, inversedBy: 'groupOfProducts')] private Collection $products; public function __construct() { $this->products = 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 getProducts(): ?object { return $this->products; } public function setProducts(object $products): static { $this->products = $products; return $this; } public function addProduct(Product $product): static { if (!$this->products->contains($product)) { $this->products->add($product); } return $this; } public function removeProduct(Product $product): static { $this->products->removeElement($product); return $this; } }