ItemCollectionProvider.php 928 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Catalog\Model\Layer\Search;
  7. use Magento\Catalog\Model\Layer\ItemCollectionProviderInterface;
  8. use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
  9. class ItemCollectionProvider implements ItemCollectionProviderInterface
  10. {
  11. /**
  12. * @var CollectionFactory
  13. */
  14. private $collectionFactory;
  15. /**
  16. * @param CollectionFactory $collectionFactory
  17. */
  18. public function __construct(CollectionFactory $collectionFactory)
  19. {
  20. $this->collectionFactory = $collectionFactory;
  21. }
  22. /**
  23. * @param \Magento\Catalog\Model\Category $category
  24. * @return \Magento\Catalog\Model\ResourceModel\Product\Collection
  25. */
  26. public function getCollection(\Magento\Catalog\Model\Category $category)
  27. {
  28. return $this->collectionFactory->create();
  29. }
  30. }