10 use Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory as AttributeCollectionFactory;
103 \
Magento\Catalog\Model\
Layer\StateFactory $layerStateFactory,
104 AttributeCollectionFactory $attributeCollectionFactory,
111 $this->_layerStateFactory = $layerStateFactory;
112 $this->_attributeCollectionFactory = $attributeCollectionFactory;
113 $this->_catalogProduct = $catalogProduct;
117 $this->collectionProvider = $context->getCollectionProvider();
118 $this->stateKeyGenerator = $context->getStateKey();
119 $this->collectionFilter = $context->getCollectionFilter();
120 parent::__construct(
$data);
130 if (!$this->_stateKey) {
178 foreach ($this->
getState()->getFilters() as $filterItem) {
179 $stateSuffix .=
'_' . $filterItem->getFilter()->getRequestVar() .
'_' . $filterItem->getValueString();
181 if (!empty($stateSuffix)) {
182 $this->_stateKey = $this->
getStateKey() . $stateSuffix;
198 $category = $this->registry->registry(
'current_category');
223 throw new \Magento\Framework\Exception\LocalizedException(
__(
'Please correct the category.'), $e);
227 throw new \Magento\Framework\Exception\LocalizedException(
__(
'Please correct the category.'));
230 throw new \Magento\Framework\Exception\LocalizedException(
231 __(
'Must be category model instance or its id.')
249 return $this->_storeManager->getStore();
259 $state = $this->
getData(
'state');
260 if ($state ===
null) {
261 \Magento\Framework\Profiler::start(__METHOD__);
262 $state = $this->_layerStateFactory->create();
263 $this->
setData(
'state', $state);
264 \Magento\Framework\Profiler::stop(__METHOD__);
prepareProductCollection($collection)
getData($key='', $index=null)
elseif(isset( $params[ 'redirect_parent']))
$_attributeCollectionFactory
__construct(\Magento\Catalog\Model\Layer\ContextInterface $context, \Magento\Catalog\Model\Layer\StateFactory $layerStateFactory, AttributeCollectionFactory $attributeCollectionFactory, \Magento\Catalog\Model\ResourceModel\Product $catalogProduct, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Registry $registry, CategoryRepositoryInterface $categoryRepository, array $data=[])
setCurrentCategory($category)
setData($key, $value=null)