/** * @return Category */ public function create() { $category = new Category(); $category->setChildren(new ArrayCollection()); $category->setProducts(new ArrayCollection()); $category->setEnabled(true); $category->setHierarchy(0); $category->setParent(null); $category->setShops(new ArrayCollection()); return $category; }
public function create() : CategoryInterface { $category = new Category(); $category->setEnabled(true); $category->setHierarchy(0); $category->setParent(null); $category->setShops($this->createEmptyCollection()); $category->setChildren($this->createEmptyCollection()); $category->setProducts($this->createEmptyCollection()); $category->setProductsCount(0); $category->setChildrenCount(0); return $category; }