Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
StateKey.php
Go to the documentation of this file.
1 <?php
9 
11 
15 class StateKey extends \Magento\Catalog\Model\Layer\Category\StateKey implements StateKeyInterface
16 {
20  protected $queryFactory;
21 
27  public function __construct(
29  \Magento\Customer\Model\Session $customerSession,
30  \Magento\Search\Model\QueryFactory $queryFactory
31  ) {
32  $this->queryFactory = $queryFactory;
33  parent::__construct($storeManager, $customerSession);
34  }
35 
39  public function toString($category)
40  {
41  return 'Q_' . $this->queryFactory->get()->getId()
42  . '_' . \Magento\Catalog\Model\Layer\Category\StateKey::toString($category);
43  }
44 }
__construct(\Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Customer\Model\Session $customerSession, \Magento\Search\Model\QueryFactory $queryFactory)
Definition: StateKey.php:27