public function indexAction() { $products = $this->_catalogModel->getCached('product')->getProductsByCategory($this->_getParam('categoryIdent', 0), $this->_getParam('page', 1), array('name')); $category = $this->_catalogModel->getCached('category')->getCategoryByIdent($this->_getParam('categoryIdent', '')); if (null === $category) { throw new SF_Exception_404('Unknown category ' . $this->_getParam('categoryIdent')); } $subs = $this->_catalogModel->getCached('category')->getCategoriesByParentId($category->categoryId); $this->getBreadcrumb($category); $this->view->assign(array('category' => $category, 'subCategories' => $subs, 'products' => $products)); }
public function Category() { $catalogModel = new Storefront_Model_Catalog(); return $catalogModel->getCached()->getCategoriesByParentId(0); }