public function addCategory(CategoryInterface $category) { if (!$this->categories->contains($category)) { $this->categories->add($category); } return $this; }