There are new things we can see at Magento 2.3 in di.xml for service contracts.

let's give an example:Magento_Cms module


  • Magento\Framework\EntityManager\MetadataPool

  • Magento\Framework\EntityManager\HydratorPool

  • Magento\Framework\EntityManager\Operation\ExtensionPool

I've seen in those classes, data interface or Repository interface as added arguments.


For Magento\Framework\EntityManager\MetadataPool's metadata, Magento add Magento\Cms\Api\Data\PageInterface as a parameter and also added entity table name and table primary key.

    <type name="Magento\Framework\EntityManager\MetadataPool">
            <argument name="metadata" xsi:type="array">
                <item name="Magento\Cms\Api\Data\PageInterface" xsi:type="array">
                    <item name="entityTableName" xsi:type="string">cms_page</item>
                    <item name="identifierField" xsi:type="string">page_id</item>
                <item name="Magento\Cms\Api\Data\BlockInterface" xsi:type="array">
                    <item name="entityTableName" xsi:type="string">cms_block</item>
                    <item name="identifierField" xsi:type="string">block_id</item>

  • Now, My question is what is Magento\Framework\EntityManager\MetadataPool and why it's needed.

  • Why add Data interface, database table name and it pk field as this class parameters.

  • If We build a custom module(Has Database table) which has server Contract, then we need to follow this process like Cms page

Same Questions, I have for Magento\Framework\EntityManager\HydratorPool

  <type name="Magento\Framework\EntityManager\HydratorPool">
            <argument name="hydrators" xsi:type="array">
                <item name="Magento\Cms\Api\Data\PageInterface" xsi:type="string">Magento\Framework\EntityManager\AbstractModelHydrator</item>
                <item name="Magento\Cms\Api\Data\BlockInterface" xsi:type="string">Magento\Framework\EntityManager\AbstractModelHydrator</item>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.