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

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

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

@param CategoryInterface $category Category

@return $this Self object
Add category .