'asc'])] private $categories; #[ORM\Column(name: 'name', unique: TRUE, nullable: FALSE)] private string $name; public function __construct() { $this->categories = new ArrayCollection(); } public function __toString(): string { return $this->name; } 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 */ public function getCategories(): Collection { return $this->categories; } public function addCategory(BrandCategory $category): self { if (!$this->categories->contains($category)) { $this->categories->add($category); } return $this; } public function removeCategory(BrandCategory $category): self { $this->categories->removeElement($category); return $this; } }