Context.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <?php
  2. /**
  3. *
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. namespace Magento\Catalog\Model\Layer;
  8. /**
  9. * Constructor modification point for Magento\Catalog\Model\Layer.
  10. *
  11. * All context classes were introduced to allow for backwards compatible constructor modifications
  12. * of classes that were supposed to be extended by extension developers.
  13. *
  14. * Do not call methods of this class directly.
  15. *
  16. * As Magento moves from inheritance-based APIs all such classes will be deprecated together with
  17. * the classes they were introduced for.
  18. */
  19. class Context implements ContextInterface
  20. {
  21. /**
  22. * @var ItemCollectionProviderInterface
  23. */
  24. protected $collectionProvider;
  25. /**
  26. * @var StateKeyInterface
  27. */
  28. protected $stateKey;
  29. /**
  30. * @var CollectionFilterInterface
  31. */
  32. protected $collectionFilter;
  33. /**
  34. * @param ItemCollectionProviderInterface $collectionProvider
  35. * @param StateKeyInterface $stateKey
  36. * @param CollectionFilterInterface $collectionFilter
  37. */
  38. public function __construct(
  39. ItemCollectionProviderInterface $collectionProvider,
  40. StateKeyInterface $stateKey,
  41. CollectionFilterInterface $collectionFilter
  42. ) {
  43. $this->collectionProvider = $collectionProvider;
  44. $this->stateKey = $stateKey;
  45. $this->collectionFilter = $collectionFilter;
  46. }
  47. /**
  48. * @return ItemCollectionProviderInterface
  49. */
  50. public function getCollectionProvider()
  51. {
  52. return $this->collectionProvider;
  53. }
  54. /**
  55. * @return StateKeyInterface
  56. */
  57. public function getStateKey()
  58. {
  59. return $this->stateKey;
  60. }
  61. /**
  62. * @return CollectionFilterInterface
  63. */
  64. public function getCollectionFilter()
  65. {
  66. return $this->collectionFilter;
  67. }
  68. }