/** * 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); }
/** * Fetch the product count by tree * * @param ProductInterface $product * * @return array */ protected function getProductCountByTree(ProductInterface $product) { return $this->productCatManager->getProductCountByTree($product); }
/** * Get children category ids * * @param CategoryInterface $category * * @return integer[] */ protected function getAllChildrenIds(CategoryInterface $category) { $categoryRepository = $this->manager->getCategoryRepository(); $categoryIds = $categoryRepository->getAllChildrenIds($category); return $categoryIds; }
/** * 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; }