Context.php 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Rule\Model\Condition;
  7. /**
  8. * Constructor modification point for Magento\Catalog\Model\Layer.
  9. *
  10. * All context classes were introduced to allow for backwards compatible constructor modifications
  11. * of classes that were supposed to be extended by extension developers.
  12. *
  13. * Do not call methods of this class directly.
  14. *
  15. * As Magento moves from inheritance-based APIs all such classes will be deprecated together with
  16. * the classes they were introduced for.
  17. *
  18. * @api
  19. * @deprecated 100.2.0
  20. * @since 100.0.2
  21. */
  22. class Context implements \Magento\Framework\ObjectManager\ContextInterface
  23. {
  24. /**
  25. * @var \Magento\Framework\View\Asset\Repository
  26. */
  27. protected $_assetRepo;
  28. /**
  29. * @var \Magento\Framework\Stdlib\DateTime\TimezoneInterface
  30. */
  31. protected $_localeDate;
  32. /**
  33. * @var \Magento\Framework\View\LayoutInterface
  34. */
  35. protected $_layout;
  36. /**
  37. * @var \Magento\Rule\Model\ConditionFactory
  38. */
  39. protected $_conditionFactory;
  40. /**
  41. * @var \Psr\Log\LoggerInterface
  42. */
  43. protected $_logger;
  44. /**
  45. * @param \Magento\Framework\View\Asset\Repository $assetRepo
  46. * @param \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate
  47. * @param \Magento\Framework\View\LayoutInterface $layout
  48. * @param \Magento\Rule\Model\ConditionFactory $conditionFactory
  49. * @param \Psr\Log\LoggerInterface $logger
  50. */
  51. public function __construct(
  52. \Magento\Framework\View\Asset\Repository $assetRepo,
  53. \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate,
  54. \Magento\Framework\View\LayoutInterface $layout,
  55. \Magento\Rule\Model\ConditionFactory $conditionFactory,
  56. \Psr\Log\LoggerInterface $logger
  57. ) {
  58. $this->_assetRepo = $assetRepo;
  59. $this->_localeDate = $localeDate;
  60. $this->_layout = $layout;
  61. $this->_conditionFactory = $conditionFactory;
  62. $this->_logger = $logger;
  63. }
  64. /**
  65. * @return \Magento\Framework\View\Asset\Repository
  66. */
  67. public function getAssetRepository()
  68. {
  69. return $this->_assetRepo;
  70. }
  71. /**
  72. * @return \Magento\Framework\Stdlib\DateTime\TimezoneInterface
  73. */
  74. public function getLocaleDate()
  75. {
  76. return $this->_localeDate;
  77. }
  78. /**
  79. * @return \Magento\Framework\View\LayoutInterface
  80. */
  81. public function getLayout()
  82. {
  83. return $this->_layout;
  84. }
  85. /**
  86. * @return \Magento\Rule\Model\ConditionFactory
  87. */
  88. public function getConditionFactory()
  89. {
  90. return $this->_conditionFactory;
  91. }
  92. /**
  93. * @return \Psr\Log\LoggerInterface
  94. */
  95. public function getLogger()
  96. {
  97. return $this->_logger;
  98. }
  99. }