69 \
Magento\Framework\
Data\CollectionFactory $dataCollectionFactory,
72 $this->_categoryFactory = $categoryFactory;
74 $this->_dataCollectionFactory = $dataCollectionFactory;
76 parent::__construct($context);
90 $parent = $this->_storeManager->getStore()->getRootCategoryId();
91 $cacheKey = sprintf(
'%d-%d-%d-%d', $parent, $sorted, $asCollection, $toLoad);
92 if (isset($this->_storeCategories[$cacheKey])) {
93 return $this->_storeCategories[$cacheKey];
99 $category = $this->_categoryFactory->create();
103 return $this->_dataCollectionFactory->create();
108 $recursionLevel = max(
110 (
int)$this->scopeConfig->getValue(
111 'catalog/navigation/max_depth',
115 $storeCategories =
$category->getCategories($parent, $recursionLevel, $sorted, $asCollection, $toLoad);
117 $this->_storeCategories[$cacheKey] = $storeCategories;
118 return $storeCategories;
132 return $this->_categoryFactory->create()->setData(
$category->getData())->getUrl();
158 if (!
$category->isInRootCategoryList()) {
173 return $this->scopeConfig->getValue(
174 self::XML_PATH_USE_CATEGORY_CANONICAL_TAG,
canUseCanonicalTag($store=null)
const XML_PATH_USE_CATEGORY_CANONICAL_TAG
getCategoryUrl($category)
__construct(\Magento\Framework\App\Helper\Context $context, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Data\CollectionFactory $dataCollectionFactory, CategoryRepositoryInterface $categoryRepository)
getStoreCategories($sorted=false, $asCollection=false, $toLoad=true)
const XML_PATH_CATEGORY_ROOT_ID