di.xml 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. <preference for="Magento\TestModuleDefaultHydrator\Api\CustomerPersistenceInterface" type="Magento\TestModuleDefaultHydrator\Model\CustomerPersistence" />
  10. <preference for="Magento\TestModuleDefaultHydrator\Api\Data\ExtensionAttributeInterface" type="Magento\TestModuleDefaultHydrator\Model\Data\ExtensionAttribute" />
  11. <type name="Magento\Framework\EntityManager\Operation\ExtensionPool">
  12. <arguments>
  13. <argument name="extensionActions" xsi:type="array">
  14. <item name="Magento\Customer\Api\Data\CustomerInterface" xsi:type="array">
  15. <item name="read" xsi:type="array">
  16. <item name="extensionAttribute" xsi:type="string">Magento\TestModuleDefaultHydrator\Model\ResourceModel\ReadHandler</item>
  17. <item name="address" xsi:type="string">Magento\TestModuleDefaultHydrator\Model\ResourceModel\Address\ReadHandler</item>
  18. </item>
  19. <item name="create" xsi:type="array">
  20. <item name="extensionAttribute" xsi:type="string">Magento\TestModuleDefaultHydrator\Model\ResourceModel\SaveHandler</item>
  21. <item name="address" xsi:type="string">Magento\TestModuleDefaultHydrator\Model\ResourceModel\Address\SaveHandler</item>
  22. </item>
  23. <item name="update" xsi:type="array">
  24. <item name="extensionAttribute" xsi:type="string">Magento\TestModuleDefaultHydrator\Model\ResourceModel\SaveHandler</item>
  25. <item name="address" xsi:type="string">Magento\TestModuleDefaultHydrator\Model\ResourceModel\Address\SaveHandler</item>
  26. </item>
  27. </item>
  28. </argument>
  29. </arguments>
  30. </type>
  31. <type name="Magento\Framework\EntityManager\MetadataPool">
  32. <arguments>
  33. <argument name="metadata" xsi:type="array">
  34. <item name="Magento\Customer\Api\Data\CustomerInterface" xsi:type="array">
  35. <item name="entityTableName" xsi:type="string">customer_entity</item>
  36. <item name="eavEntityType" xsi:type="string">customer</item>
  37. <item name="identifierField" xsi:type="string">entity_id</item>
  38. </item>
  39. <item name="Magento\Customer\Api\Data\AddressInterface" xsi:type="array">
  40. <item name="entityTableName" xsi:type="string">customer_address_entity</item>
  41. <item name="eavEntityType" xsi:type="string">customer_address</item>
  42. <item name="identifierField" xsi:type="string">entity_id</item>
  43. </item>
  44. <item name="Magento\TestModuleDefaultHydrator\Api\Data\ExtensionAttributeInterface" xsi:type="array">
  45. <item name="entityTableName" xsi:type="string">testmodule_default_hydrator_extension_attribute_entity</item>
  46. <item name="identifierField" xsi:type="string">entity_id</item>
  47. </item>
  48. </argument>
  49. </arguments>
  50. </type>
  51. <type name="Magento\Framework\EntityManager\Mapper">
  52. <arguments>
  53. <argument name="config" xsi:type="array">
  54. <item name="Magento\Customer\Api\Data\CustomerInterface" xsi:type="array">
  55. <item name="entity_id" xsi:type="string">id</item>
  56. </item>
  57. <item name="Magento\Customer\Api\Data\AddressInterface" xsi:type="array">
  58. <item name="parent_id" xsi:type="string">customer_id</item>
  59. </item>
  60. </argument>
  61. </arguments>
  62. </type>
  63. <virtualType name="customerAddressMapper" type="Magento\Framework\EntityManager\CompositeMapper">
  64. <arguments>
  65. <argument name="mappers" xsi:type="array">
  66. <item name="addressMapper" xsi:type="object">Magento\TestModuleDefaultHydrator\Model\Address\Mapper</item>
  67. </argument>
  68. </arguments>
  69. </virtualType>
  70. <type name="Magento\Framework\EntityManager\MapperPool">
  71. <arguments>
  72. <argument name="mappers" xsi:type="array">
  73. <item name="Magento\Customer\Api\Data\AddressInterface" xsi:type="string">customerAddressMapper</item>
  74. </argument>
  75. </arguments>
  76. </type>
  77. </config>