di.xml 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167
  1. <?xml version="1.0"?>
  2. <!--
  3. /**
  4. * Copyright © Magento, Inc. All rights reserved.
  5. * See COPYING.txt for license details.
  6. */
  7. -->
  8. <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:ObjectManager/etc/config.xsd">
  9. <type name="Magento\Downloadable\Helper\Download">
  10. <arguments>
  11. <argument name="coreFileStorageDb" xsi:type="object">Magento\MediaStorage\Helper\File\Storage\Database\Proxy</argument>
  12. </arguments>
  13. </type>
  14. <type name="Magento\Catalog\Model\Product\CartConfiguration">
  15. <plugin name="Downloadable" type="Magento\Downloadable\Model\Product\CartConfiguration\Plugin\Downloadable" />
  16. </type>
  17. <virtualType name="context_for_downloadable" type="Magento\Framework\View\Element\Template\Context">
  18. <arguments>
  19. <argument name="urlBuilder" xsi:type="object">Magento\Framework\Url</argument>
  20. </arguments>
  21. </virtualType>
  22. <type name="Magento\Downloadable\Block\Sales\Order\Email\Items\Order\Downloadable">
  23. <arguments>
  24. <argument name="context" xsi:type="object">context_for_downloadable</argument>
  25. </arguments>
  26. </type>
  27. <type name="Magento\Catalog\Model\Product\TypeTransitionManager">
  28. <plugin name="downloadable_product_transition" type="Magento\Downloadable\Model\Product\TypeTransitionManager\Plugin\Downloadable" />
  29. <arguments>
  30. <argument name="compatibleTypes" xsi:type="array">
  31. <item name="downloadable" xsi:type="const">Magento\Downloadable\Model\Product\Type::TYPE_DOWNLOADABLE</item>
  32. </argument>
  33. </arguments>
  34. </type>
  35. <virtualType name="Magento\Downloadable\Pricing\Price\Pool" type="Magento\Framework\Pricing\Price\Pool">
  36. <arguments>
  37. <argument name="prices" xsi:type="array">
  38. <item name="link_price" xsi:type="string">Magento\Downloadable\Pricing\Price\LinkPrice</item>
  39. </argument>
  40. <argument name="target" xsi:type="object">Magento\Catalog\Pricing\Price\Pool</argument>
  41. </arguments>
  42. </virtualType>
  43. <virtualType name="Magento\Downloadable\Pricing\Price\Collection" type="Magento\Framework\Pricing\Price\Collection">
  44. <arguments>
  45. <argument name="pool" xsi:type="object">Magento\Downloadable\Pricing\Price\Pool</argument>
  46. </arguments>
  47. </virtualType>
  48. <type name="Magento\Framework\Pricing\PriceInfo\Factory">
  49. <arguments>
  50. <argument name="types" xsi:type="array">
  51. <item name="downloadable" xsi:type="array">
  52. <item name="infoClass" xsi:type="string">Magento\Framework\Pricing\PriceInfo\Base</item>
  53. <item name="prices" xsi:type="string">Magento\Downloadable\Pricing\Price\Collection</item>
  54. </item>
  55. </argument>
  56. </arguments>
  57. </type>
  58. <type name="Magento\Downloadable\Model\Product\TypeHandler\TypeHandler">
  59. <arguments>
  60. <argument name="handlers" xsi:type="array">
  61. <item name="sample" xsi:type="object">Magento\Downloadable\Model\Product\TypeHandler\Sample</item>
  62. <item name="link" xsi:type="object">Magento\Downloadable\Model\Product\TypeHandler\Link</item>
  63. </argument>
  64. </arguments>
  65. </type>
  66. <type name="Magento\Quote\Model\Quote\Item\Repository">
  67. <arguments>
  68. <argument name="cartItemProcessors" xsi:type="array">
  69. <item name="downloadable" xsi:type="object">Magento\Downloadable\Model\Quote\Item\CartItemProcessor\Proxy</item>
  70. </argument>
  71. </arguments>
  72. </type>
  73. <type name="Magento\Sales\Api\OrderItemRepositoryInterface">
  74. <arguments>
  75. <argument name="processorPool" xsi:type="array">
  76. <item name="downloadable" xsi:type="object">Magento\Downloadable\Model\ProductOptionProcessor</item>
  77. </argument>
  78. </arguments>
  79. </type>
  80. <type name="Magento\Sales\Model\Order\ProductOption">
  81. <arguments>
  82. <argument name="processorPool" xsi:type="array">
  83. <item name="downloadable" xsi:type="object">Magento\Downloadable\Model\ProductOptionProcessor</item>
  84. </argument>
  85. </arguments>
  86. </type>
  87. <preference for="Magento\Downloadable\Api\LinkRepositoryInterface" type="Magento\Downloadable\Model\LinkRepository" />
  88. <preference for="Magento\Downloadable\Api\SampleRepositoryInterface" type="Magento\Downloadable\Model\SampleRepository" />
  89. <preference for="Magento\Downloadable\Api\Data\LinkInterface" type="Magento\Downloadable\Model\Link" />
  90. <preference for="Magento\Downloadable\Api\Data\SampleInterface" type="Magento\Downloadable\Model\Sample" />
  91. <preference for="Magento\Downloadable\Api\Data\File\ContentInterface" type="Magento\Downloadable\Model\File\Content" />
  92. <preference for="Magento\Downloadable\Api\Data\File\ContentUploaderInterface" type="Magento\Downloadable\Model\File\ContentUploader" />
  93. <preference for="Magento\Downloadable\Model\Product\TypeHandler\TypeHandlerInterface" type="Magento\Downloadable\Model\Product\TypeHandler\TypeHandler" />
  94. <preference for="Magento\Downloadable\Api\Data\DownloadableOptionInterface" type="Magento\Downloadable\Model\DownloadableOption" />
  95. <type name="Magento\Framework\EntityManager\Operation\ExtensionPool">
  96. <arguments>
  97. <argument name="extensionActions" xsi:type="array">
  98. <item name="Magento\Catalog\Api\Data\ProductInterface" xsi:type="array">
  99. <item name="read" xsi:type="array">
  100. <item name="downloadable_link_read" xsi:type="string">Magento\Downloadable\Model\Link\ReadHandler</item>
  101. <item name="downloadable_sample_read" xsi:type="string">Magento\Downloadable\Model\Sample\ReadHandler</item>
  102. </item>
  103. <item name="create" xsi:type="array">
  104. <item name="downloadable_link_create" xsi:type="string">Magento\Downloadable\Model\Link\CreateHandler</item>
  105. <item name="downloadable_sample_create" xsi:type="string">Magento\Downloadable\Model\Sample\CreateHandler</item>
  106. </item>
  107. <item name="update" xsi:type="array">
  108. <item name="downloadable_link_update" xsi:type="string">Magento\Downloadable\Model\Sample\UpdateHandler</item>
  109. <item name="downloadable_sample_update" xsi:type="string">Magento\Downloadable\Model\Link\UpdateHandler</item>
  110. </item>
  111. <item name="delete" xsi:type="array">
  112. <item name="downloadable_link_delete" xsi:type="string">Magento\Downloadable\Model\Sample\DeleteHandler</item>
  113. <item name="downloadable_sample_delete" xsi:type="string">Magento\Downloadable\Model\Link\DeleteHandler</item>
  114. </item>
  115. </item>
  116. </argument>
  117. </arguments>
  118. </type>
  119. <type name="Magento\Framework\EntityManager\MetadataPool">
  120. <arguments>
  121. <argument name="metadata" xsi:type="array">
  122. <item name="Magento\Downloadable\Api\Data\LinkInterface" xsi:type="array">
  123. <item name="entityTableName" xsi:type="string">downloadable_link</item>
  124. <item name="identifierField" xsi:type="string">link_id</item>
  125. </item>
  126. <item name="Magento\Downloadable\Api\Data\SampleInterface" xsi:type="array">
  127. <item name="entityTableName" xsi:type="string">downloadable_sample</item>
  128. <item name="identifierField" xsi:type="string">sample_id</item>
  129. </item>
  130. </argument>
  131. </arguments>
  132. </type>
  133. <type name="Magento\Catalog\Model\Product\Price\CostStorage">
  134. <arguments>
  135. <argument name="allowedProductTypes" xsi:type="array">
  136. <item name="2" xsi:type="string">downloadable</item>
  137. </argument>
  138. </arguments>
  139. </type>
  140. <type name="Magento\Catalog\Model\Product\Price\Validation\TierPriceValidator">
  141. <arguments>
  142. <argument name="allowedProductTypes" xsi:type="array">
  143. <item name="3" xsi:type="string">downloadable</item>
  144. </argument>
  145. </arguments>
  146. </type>
  147. <type name="Magento\Catalog\Model\Product\Price\BasePriceStorage">
  148. <arguments>
  149. <argument name="allowedProductTypes" xsi:type="array">
  150. <item name="3" xsi:type="string">downloadable</item>
  151. </argument>
  152. </arguments>
  153. </type>
  154. <type name="Magento\Catalog\Model\Product\Price\SpecialPriceStorage">
  155. <arguments>
  156. <argument name="allowedProductTypes" xsi:type="array">
  157. <item name="3" xsi:type="string">downloadable</item>
  158. </argument>
  159. </arguments>
  160. </type>
  161. <type name="Magento\Downloadable\Model\ResourceModel\Indexer\Price">
  162. <arguments>
  163. <argument name="tableStrategy" xsi:type="object">Magento\Catalog\Model\ResourceModel\Product\Indexer\TemporaryTableStrategy</argument>
  164. <argument name="connectionName" xsi:type="string">indexer</argument>
  165. </arguments>
  166. </type>
  167. </config>