コード例 #1
0
 /**
  * Count products for a category
  *
  * @param CategoryInterface $category
  * @param bool              $includeSub
  * @param string            $relatedEntity
  *
  * @return integer
  */
 protected function countProducts(CategoryInterface $category, $includeSub, $relatedEntity)
 {
     return $this->manager->getProductsCountInCategory($category, $includeSub);
 }
コード例 #2
0
 /**
  * Fetch the product count by tree
  *
  * @param ProductInterface $product
  *
  * @return array
  */
 protected function getProductCountByTree(ProductInterface $product)
 {
     return $this->productCatManager->getProductCountByTree($product);
 }
コード例 #3
0
 /**
  * Get children category ids
  *
  * @param CategoryInterface $category
  *
  * @return integer[]
  */
 protected function getAllChildrenIds(CategoryInterface $category)
 {
     $categoryRepository = $this->manager->getCategoryRepository();
     $categoryIds = $categoryRepository->getAllChildrenIds($category);
     return $categoryIds;
 }
コード例 #4
0
 /**
  * Get product ids in category (and children)
  *
  * @param CategoryInterface $category
  * @param array             $data
  *
  * @return integer[]
  */
 protected function getProductIdsInCategory(CategoryInterface $category, $data)
 {
     $productIds = $this->manager->getProductIdsInCategory($category, $data['includeSub']);
     return empty($productIds) ? array(0) : $productIds;
 }