コード例 #1
0
 /**
  * @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;
 }
コード例 #2
0
 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;
 }