Context.php 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Eav\Model\Entity;
  7. /**
  8. * Constructor modification point for Magento\Eav\Model\Entity.
  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. * @codeCoverageIgnore
  20. * @since 100.0.2
  21. */
  22. class Context implements \Magento\Framework\ObjectManager\ContextInterface
  23. {
  24. /**
  25. * @var \Magento\Eav\Model\Config
  26. */
  27. protected $eavConfig;
  28. /**
  29. * @var \Magento\Framework\App\ResourceConnection
  30. */
  31. protected $resource;
  32. /**
  33. * @var Attribute\Set
  34. */
  35. protected $attributeSetEntity;
  36. /**
  37. * @var \Magento\Framework\Locale\FormatInterface
  38. */
  39. protected $localeFormat;
  40. /**
  41. * @var \Magento\Eav\Model\ResourceModel\Helper
  42. */
  43. protected $resourceHelper;
  44. /**
  45. * @var \Magento\Framework\Validator\UniversalFactory
  46. */
  47. protected $universalFactory;
  48. /**
  49. * @var \Magento\Framework\Model\ResourceModel\Db\TransactionManagerInterface
  50. */
  51. protected $transactionManager;
  52. /**
  53. * @var \Magento\Framework\Model\ResourceModel\Db\ObjectRelationProcessor
  54. */
  55. protected $objectRelationProcessor;
  56. /**
  57. * @param \Magento\Framework\App\ResourceConnection $resource
  58. * @param \Magento\Eav\Model\Config $eavConfig
  59. * @param Attribute\Set $attrSetEntity
  60. * @param \Magento\Framework\Locale\FormatInterface $localeFormat
  61. * @param \Magento\Eav\Model\ResourceModel\Helper $resourceHelper
  62. * @param \Magento\Framework\Validator\UniversalFactory $universalFactory
  63. * @param \Magento\Framework\Model\ResourceModel\Db\TransactionManagerInterface $transactionManager
  64. * @param \Magento\Framework\Model\ResourceModel\Db\ObjectRelationProcessor $objectRelationProcessor
  65. */
  66. public function __construct(
  67. \Magento\Framework\App\ResourceConnection $resource,
  68. \Magento\Eav\Model\Config $eavConfig,
  69. \Magento\Eav\Model\Entity\Attribute\Set $attrSetEntity,
  70. \Magento\Framework\Locale\FormatInterface $localeFormat,
  71. \Magento\Eav\Model\ResourceModel\Helper $resourceHelper,
  72. \Magento\Framework\Validator\UniversalFactory $universalFactory,
  73. \Magento\Framework\Model\ResourceModel\Db\TransactionManagerInterface $transactionManager,
  74. \Magento\Framework\Model\ResourceModel\Db\ObjectRelationProcessor $objectRelationProcessor
  75. ) {
  76. $this->eavConfig = $eavConfig;
  77. $this->resource = $resource;
  78. $this->attributeSetEntity = $attrSetEntity;
  79. $this->localeFormat = $localeFormat;
  80. $this->resourceHelper = $resourceHelper;
  81. $this->universalFactory = $universalFactory;
  82. $this->transactionManager = $transactionManager;
  83. $this->objectRelationProcessor = $objectRelationProcessor;
  84. }
  85. /**
  86. * @return \Magento\Eav\Model\Config
  87. */
  88. public function getEavConfig()
  89. {
  90. return $this->eavConfig;
  91. }
  92. /**
  93. * @return \Magento\Framework\App\ResourceConnection
  94. */
  95. public function getResource()
  96. {
  97. return $this->resource;
  98. }
  99. /**
  100. * @return Attribute\Set
  101. */
  102. public function getAttributeSetEntity()
  103. {
  104. return $this->attributeSetEntity;
  105. }
  106. /**
  107. * @return \Magento\Framework\Locale\FormatInterface
  108. */
  109. public function getLocaleFormat()
  110. {
  111. return $this->localeFormat;
  112. }
  113. /**
  114. * @return \Magento\Eav\Model\ResourceModel\Helper
  115. */
  116. public function getResourceHelper()
  117. {
  118. return $this->resourceHelper;
  119. }
  120. /**
  121. * @return \Magento\Framework\Validator\UniversalFactory
  122. */
  123. public function getUniversalFactory()
  124. {
  125. return $this->universalFactory;
  126. }
  127. /**
  128. * @return \Magento\Framework\Model\ResourceModel\Db\ObjectRelationProcessor
  129. */
  130. public function getObjectRelationProcessor()
  131. {
  132. return $this->objectRelationProcessor;
  133. }
  134. /**
  135. * @return \Magento\Framework\Model\ResourceModel\Db\TransactionManagerInterface
  136. */
  137. public function getTransactionManager()
  138. {
  139. return $this->transactionManager;
  140. }
  141. }