Unknown entity type: NamespaceModuleModelName requestedHow can i rewrite TierPrice Block in Magento2How to add date filed in admin & show on front in magento2Observer event Argument 1 passed to AbstractDb::load() must be an instance of AbstractModelWhat is the proper way of implementing service contracts in Magento 2?Magento 2: Plugin class does not existHaving trouble exporting products from Magento 2.x. Fatal error: Uncaught Error: Call to a member function getName()Not able to add/update magento2 category post upgrade from 1.9 to 2.1.0I am trying to override multishipping.php file in vendor/magento/module-multishipping/Model/Checkout/Type/Multishipping.phpMagento2 REST API get all customers detailsget invoice item using order_item_id in magento 2

Why one uses 了 and the other one doesn’t?

In the US, can a former president run again?

My student in one course asks for paid tutoring in another course. Appropriate?

Is using legacy mode instead of UEFI mode a bad thing to do?

How much steel armor can you wear and still be able to swim?

S&P 500 Index Value

Name for a function whose effect is canceled by another function?

How do I find which software is doing an SSH connection?

Why is it 出差去 and not 去出差?

Setting up the trap

What is the maximum that Player 1 can win?

Are there examples of rowers who also fought?

What is this plant I saw for sale at a Romanian farmer's market?

In Street Fighter, what does the M stand for in M Bison?

Can I apply for a working holiday visa at age 30 and get the full 12 months?

How did Frodo know where the Bree village was?

Why is it easier to balance a non-moving bike standing up than sitting down?

Can the pre-order traversal of two different trees be the same even though they are different?

Am I legally required to provide a (GPL licensed) source code even after a project is abandoned?

How would one carboxylate CBG into its acid form, CBGA?

Bent arrow under a node

What is this airplane that sits in front of Barringer High School in Newark, NJ?

Is Newton's third law really correct?

Why is Havana covered in 5-digit numbers in Our Man in Havana?



Unknown entity type: NamespaceModuleModelName requested


How can i rewrite TierPrice Block in Magento2How to add date filed in admin & show on front in magento2Observer event Argument 1 passed to AbstractDb::load() must be an instance of AbstractModelWhat is the proper way of implementing service contracts in Magento 2?Magento 2: Plugin class does not existHaving trouble exporting products from Magento 2.x. Fatal error: Uncaught Error: Call to a member function getName()Not able to add/update magento2 category post upgrade from 1.9 to 2.1.0I am trying to override multishipping.php file in vendor/magento/module-multishipping/Model/Checkout/Type/Multishipping.phpMagento2 REST API get all customers detailsget invoice item using order_item_id in magento 2






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








1















I am trying to understand this exception: Unknown entity type: NamespaceModuleModelName requested



I have a module and I am loading it like this in my controller:



$model = $this->_objectManager->create(NamespaceModuleModelName::class);
$model->load($id);


and in my resource model: class NamespaceModuleModelResourceModelName, I have this:



/**
* Load an object
*
* @param AbstractModel $object
* @param mixed $value
* @param string $field field to load by (defaults to model id)
* @return $this
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function load(AbstractModel $object, $value, $field = null)

$this->getEntityManager()->load($object, $value);
return $this;



Then in my di.xml, I have got this:



<type name="MagentoFrameworkModelEntityRepositoryFactory">
<arguments>
<argument name="entities" xsi:type="array">
<item name="NamespaceModuleApiDataNameInterface" xsi:type="string">NamespaceModuleModelResourceModelName</item>
</argument>
</arguments>
</type>
<type name="MagentoFrameworkEntityManagerMetadataPool">
<arguments>
<argument name="metadata" xsi:type="array">
<item name="NamespaceModuleApiDataNameInterface" xsi:type="array">
<item name="entityTableName" xsi:type="string">my_table</item>
<item name="identifierField" xsi:type="string">my_id</item>
</item>
</argument>
</arguments>
</type>


<type name="MagentoFrameworkEntityManagerOperationAttributePool">
<arguments>
<argument name="extensionActions" xsi:type="array">
<item name="myName" xsi:type="array">
<item name="NamespaceModuleApiDataNameInterface" xsi:type="array">
<item name="read" xsi:type="string">NamespaceModuleModelResourceModelReadHandler</item>
<item name="create" xsi:type="string">NamespaceModuleModelResourceModelSaveHandler</item>
<item name="update" xsi:type="string">NamespaceModuleModelResourceModelSaveHandler</item>
</item>
</item>
</argument>
</arguments>
</type>


Why is that throwing the exception?



How do I understand this MetadataPool?



UPDATE 1



I have checked further and found that MagentoFrameworkEntityManagerMetadataPool::getMetadata($entityType) is receiving NamespaceModuleModelName as argument. It supposed to receive NamespaceModuleApiDataNameInterface.



Doing var_dump($this->metadata) does shows there is NamespaceModuleApiDataNameInterface in the $this->metadata array.



What am I missing?










share|improve this question
























  • this is helpful to you.

    – tokey
    Jun 11 at 2:21











  • Have checked MagentoFrameworkEntityManagerMetadataPool::getMetadata($entityType), but cannot find the culprit. Plez check updated question.

    – Adarsh Khatri
    Jun 11 at 2:46

















1















I am trying to understand this exception: Unknown entity type: NamespaceModuleModelName requested



I have a module and I am loading it like this in my controller:



$model = $this->_objectManager->create(NamespaceModuleModelName::class);
$model->load($id);


and in my resource model: class NamespaceModuleModelResourceModelName, I have this:



/**
* Load an object
*
* @param AbstractModel $object
* @param mixed $value
* @param string $field field to load by (defaults to model id)
* @return $this
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function load(AbstractModel $object, $value, $field = null)

$this->getEntityManager()->load($object, $value);
return $this;



Then in my di.xml, I have got this:



<type name="MagentoFrameworkModelEntityRepositoryFactory">
<arguments>
<argument name="entities" xsi:type="array">
<item name="NamespaceModuleApiDataNameInterface" xsi:type="string">NamespaceModuleModelResourceModelName</item>
</argument>
</arguments>
</type>
<type name="MagentoFrameworkEntityManagerMetadataPool">
<arguments>
<argument name="metadata" xsi:type="array">
<item name="NamespaceModuleApiDataNameInterface" xsi:type="array">
<item name="entityTableName" xsi:type="string">my_table</item>
<item name="identifierField" xsi:type="string">my_id</item>
</item>
</argument>
</arguments>
</type>


<type name="MagentoFrameworkEntityManagerOperationAttributePool">
<arguments>
<argument name="extensionActions" xsi:type="array">
<item name="myName" xsi:type="array">
<item name="NamespaceModuleApiDataNameInterface" xsi:type="array">
<item name="read" xsi:type="string">NamespaceModuleModelResourceModelReadHandler</item>
<item name="create" xsi:type="string">NamespaceModuleModelResourceModelSaveHandler</item>
<item name="update" xsi:type="string">NamespaceModuleModelResourceModelSaveHandler</item>
</item>
</item>
</argument>
</arguments>
</type>


Why is that throwing the exception?



How do I understand this MetadataPool?



UPDATE 1



I have checked further and found that MagentoFrameworkEntityManagerMetadataPool::getMetadata($entityType) is receiving NamespaceModuleModelName as argument. It supposed to receive NamespaceModuleApiDataNameInterface.



Doing var_dump($this->metadata) does shows there is NamespaceModuleApiDataNameInterface in the $this->metadata array.



What am I missing?










share|improve this question
























  • this is helpful to you.

    – tokey
    Jun 11 at 2:21











  • Have checked MagentoFrameworkEntityManagerMetadataPool::getMetadata($entityType), but cannot find the culprit. Plez check updated question.

    – Adarsh Khatri
    Jun 11 at 2:46













1












1








1








I am trying to understand this exception: Unknown entity type: NamespaceModuleModelName requested



I have a module and I am loading it like this in my controller:



$model = $this->_objectManager->create(NamespaceModuleModelName::class);
$model->load($id);


and in my resource model: class NamespaceModuleModelResourceModelName, I have this:



/**
* Load an object
*
* @param AbstractModel $object
* @param mixed $value
* @param string $field field to load by (defaults to model id)
* @return $this
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function load(AbstractModel $object, $value, $field = null)

$this->getEntityManager()->load($object, $value);
return $this;



Then in my di.xml, I have got this:



<type name="MagentoFrameworkModelEntityRepositoryFactory">
<arguments>
<argument name="entities" xsi:type="array">
<item name="NamespaceModuleApiDataNameInterface" xsi:type="string">NamespaceModuleModelResourceModelName</item>
</argument>
</arguments>
</type>
<type name="MagentoFrameworkEntityManagerMetadataPool">
<arguments>
<argument name="metadata" xsi:type="array">
<item name="NamespaceModuleApiDataNameInterface" xsi:type="array">
<item name="entityTableName" xsi:type="string">my_table</item>
<item name="identifierField" xsi:type="string">my_id</item>
</item>
</argument>
</arguments>
</type>


<type name="MagentoFrameworkEntityManagerOperationAttributePool">
<arguments>
<argument name="extensionActions" xsi:type="array">
<item name="myName" xsi:type="array">
<item name="NamespaceModuleApiDataNameInterface" xsi:type="array">
<item name="read" xsi:type="string">NamespaceModuleModelResourceModelReadHandler</item>
<item name="create" xsi:type="string">NamespaceModuleModelResourceModelSaveHandler</item>
<item name="update" xsi:type="string">NamespaceModuleModelResourceModelSaveHandler</item>
</item>
</item>
</argument>
</arguments>
</type>


Why is that throwing the exception?



How do I understand this MetadataPool?



UPDATE 1



I have checked further and found that MagentoFrameworkEntityManagerMetadataPool::getMetadata($entityType) is receiving NamespaceModuleModelName as argument. It supposed to receive NamespaceModuleApiDataNameInterface.



Doing var_dump($this->metadata) does shows there is NamespaceModuleApiDataNameInterface in the $this->metadata array.



What am I missing?










share|improve this question
















I am trying to understand this exception: Unknown entity type: NamespaceModuleModelName requested



I have a module and I am loading it like this in my controller:



$model = $this->_objectManager->create(NamespaceModuleModelName::class);
$model->load($id);


and in my resource model: class NamespaceModuleModelResourceModelName, I have this:



/**
* Load an object
*
* @param AbstractModel $object
* @param mixed $value
* @param string $field field to load by (defaults to model id)
* @return $this
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function load(AbstractModel $object, $value, $field = null)

$this->getEntityManager()->load($object, $value);
return $this;



Then in my di.xml, I have got this:



<type name="MagentoFrameworkModelEntityRepositoryFactory">
<arguments>
<argument name="entities" xsi:type="array">
<item name="NamespaceModuleApiDataNameInterface" xsi:type="string">NamespaceModuleModelResourceModelName</item>
</argument>
</arguments>
</type>
<type name="MagentoFrameworkEntityManagerMetadataPool">
<arguments>
<argument name="metadata" xsi:type="array">
<item name="NamespaceModuleApiDataNameInterface" xsi:type="array">
<item name="entityTableName" xsi:type="string">my_table</item>
<item name="identifierField" xsi:type="string">my_id</item>
</item>
</argument>
</arguments>
</type>


<type name="MagentoFrameworkEntityManagerOperationAttributePool">
<arguments>
<argument name="extensionActions" xsi:type="array">
<item name="myName" xsi:type="array">
<item name="NamespaceModuleApiDataNameInterface" xsi:type="array">
<item name="read" xsi:type="string">NamespaceModuleModelResourceModelReadHandler</item>
<item name="create" xsi:type="string">NamespaceModuleModelResourceModelSaveHandler</item>
<item name="update" xsi:type="string">NamespaceModuleModelResourceModelSaveHandler</item>
</item>
</item>
</argument>
</arguments>
</type>


Why is that throwing the exception?



How do I understand this MetadataPool?



UPDATE 1



I have checked further and found that MagentoFrameworkEntityManagerMetadataPool::getMetadata($entityType) is receiving NamespaceModuleModelName as argument. It supposed to receive NamespaceModuleApiDataNameInterface.



Doing var_dump($this->metadata) does shows there is NamespaceModuleApiDataNameInterface in the $this->metadata array.



What am I missing?







magento2






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 11 at 2:45







Adarsh Khatri

















asked Jun 11 at 0:58









Adarsh KhatriAdarsh Khatri

6,76011744




6,76011744












  • this is helpful to you.

    – tokey
    Jun 11 at 2:21











  • Have checked MagentoFrameworkEntityManagerMetadataPool::getMetadata($entityType), but cannot find the culprit. Plez check updated question.

    – Adarsh Khatri
    Jun 11 at 2:46

















  • this is helpful to you.

    – tokey
    Jun 11 at 2:21











  • Have checked MagentoFrameworkEntityManagerMetadataPool::getMetadata($entityType), but cannot find the culprit. Plez check updated question.

    – Adarsh Khatri
    Jun 11 at 2:46
















this is helpful to you.

– tokey
Jun 11 at 2:21





this is helpful to you.

– tokey
Jun 11 at 2:21













Have checked MagentoFrameworkEntityManagerMetadataPool::getMetadata($entityType), but cannot find the culprit. Plez check updated question.

– Adarsh Khatri
Jun 11 at 2:46





Have checked MagentoFrameworkEntityManagerMetadataPool::getMetadata($entityType), but cannot find the culprit. Plez check updated question.

– Adarsh Khatri
Jun 11 at 2:46










2 Answers
2






active

oldest

votes


















1














 <!-- Register the Abstract Repositories -->
<type name="MagentoFrameworkModelEntityRepositoryFactory">
<arguments>
<argument name="entities" xsi:type="array">
<item name="NamespaceModuleApiNameRepositoryInterface" xsi:type="string">NamespaceModuleApiNameRepositoryInterface</item>
</argument>
</arguments>
</type>





share|improve this answer























  • This doesn't help.

    – Adarsh Khatri
    Jun 11 at 5:11


















0














Right, so I have forgotten to implement NameInterface to my model Name.



Once added the interface implementation, right $entityType was passed and was loading successfully.



<?php 
namespace NamespaceModuleModel;

class Name extends MagentoFrameworkModelAbstractExtensibleModel implements NamespaceModuleApiDataNameInterface




And, obviously <preference for="NamespaceModuleApiDataNameInterface" type="NamespaceModuleModelName" /> in my di.xml



Hope this helps someone.






share|improve this answer























    Your Answer








    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "479"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: false,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: null,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













    draft saved

    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f277884%2funknown-entity-type-namespace-module-model-name-requested%23new-answer', 'question_page');

    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














     <!-- Register the Abstract Repositories -->
    <type name="MagentoFrameworkModelEntityRepositoryFactory">
    <arguments>
    <argument name="entities" xsi:type="array">
    <item name="NamespaceModuleApiNameRepositoryInterface" xsi:type="string">NamespaceModuleApiNameRepositoryInterface</item>
    </argument>
    </arguments>
    </type>





    share|improve this answer























    • This doesn't help.

      – Adarsh Khatri
      Jun 11 at 5:11















    1














     <!-- Register the Abstract Repositories -->
    <type name="MagentoFrameworkModelEntityRepositoryFactory">
    <arguments>
    <argument name="entities" xsi:type="array">
    <item name="NamespaceModuleApiNameRepositoryInterface" xsi:type="string">NamespaceModuleApiNameRepositoryInterface</item>
    </argument>
    </arguments>
    </type>





    share|improve this answer























    • This doesn't help.

      – Adarsh Khatri
      Jun 11 at 5:11













    1












    1








    1







     <!-- Register the Abstract Repositories -->
    <type name="MagentoFrameworkModelEntityRepositoryFactory">
    <arguments>
    <argument name="entities" xsi:type="array">
    <item name="NamespaceModuleApiNameRepositoryInterface" xsi:type="string">NamespaceModuleApiNameRepositoryInterface</item>
    </argument>
    </arguments>
    </type>





    share|improve this answer













     <!-- Register the Abstract Repositories -->
    <type name="MagentoFrameworkModelEntityRepositoryFactory">
    <arguments>
    <argument name="entities" xsi:type="array">
    <item name="NamespaceModuleApiNameRepositoryInterface" xsi:type="string">NamespaceModuleApiNameRepositoryInterface</item>
    </argument>
    </arguments>
    </type>






    share|improve this answer












    share|improve this answer



    share|improve this answer










    answered Jun 11 at 3:48









    tokeytokey

    862




    862












    • This doesn't help.

      – Adarsh Khatri
      Jun 11 at 5:11

















    • This doesn't help.

      – Adarsh Khatri
      Jun 11 at 5:11
















    This doesn't help.

    – Adarsh Khatri
    Jun 11 at 5:11





    This doesn't help.

    – Adarsh Khatri
    Jun 11 at 5:11













    0














    Right, so I have forgotten to implement NameInterface to my model Name.



    Once added the interface implementation, right $entityType was passed and was loading successfully.



    <?php 
    namespace NamespaceModuleModel;

    class Name extends MagentoFrameworkModelAbstractExtensibleModel implements NamespaceModuleApiDataNameInterface




    And, obviously <preference for="NamespaceModuleApiDataNameInterface" type="NamespaceModuleModelName" /> in my di.xml



    Hope this helps someone.






    share|improve this answer



























      0














      Right, so I have forgotten to implement NameInterface to my model Name.



      Once added the interface implementation, right $entityType was passed and was loading successfully.



      <?php 
      namespace NamespaceModuleModel;

      class Name extends MagentoFrameworkModelAbstractExtensibleModel implements NamespaceModuleApiDataNameInterface




      And, obviously <preference for="NamespaceModuleApiDataNameInterface" type="NamespaceModuleModelName" /> in my di.xml



      Hope this helps someone.






      share|improve this answer

























        0












        0








        0







        Right, so I have forgotten to implement NameInterface to my model Name.



        Once added the interface implementation, right $entityType was passed and was loading successfully.



        <?php 
        namespace NamespaceModuleModel;

        class Name extends MagentoFrameworkModelAbstractExtensibleModel implements NamespaceModuleApiDataNameInterface




        And, obviously <preference for="NamespaceModuleApiDataNameInterface" type="NamespaceModuleModelName" /> in my di.xml



        Hope this helps someone.






        share|improve this answer













        Right, so I have forgotten to implement NameInterface to my model Name.



        Once added the interface implementation, right $entityType was passed and was loading successfully.



        <?php 
        namespace NamespaceModuleModel;

        class Name extends MagentoFrameworkModelAbstractExtensibleModel implements NamespaceModuleApiDataNameInterface




        And, obviously <preference for="NamespaceModuleApiDataNameInterface" type="NamespaceModuleModelName" /> in my di.xml



        Hope this helps someone.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jun 12 at 1:47









        Adarsh KhatriAdarsh Khatri

        6,76011744




        6,76011744



























            draft saved

            draft discarded
















































            Thanks for contributing an answer to Magento Stack Exchange!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid


            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.

            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f277884%2funknown-entity-type-namespace-module-model-name-requested%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Category:9 (number) SubcategoriesMedia in category "9 (number)"Navigation menuUpload mediaGND ID: 4485639-8Library of Congress authority ID: sh85091979ReasonatorScholiaStatistics

            Circuit construction for execution of conditional statements using least significant bitHow are two different registers being used as “control”?How exactly is the stated composite state of the two registers being produced using the $R_zz$ controlled rotations?Efficiently performing controlled rotations in HHLWould this quantum algorithm implementation work?How to prepare a superposed states of odd integers from $1$ to $sqrtN$?Why is this implementation of the order finding algorithm not working?Circuit construction for Hamiltonian simulationHow can I invert the least significant bit of a certain term of a superposed state?Implementing an oracleImplementing a controlled sum operation

            Magento 2 “No Payment Methods” in Admin New OrderHow to integrate Paypal Express Checkout with the Magento APIMagento 1.5 - Sales > Order > edit order and shipping methods disappearAuto Invoice Check/Money Order Payment methodAdd more simple payment methods?Shipping methods not showingWhat should I do to change payment methods if changing the configuration has no effects?1.9 - No Payment Methods showing upMy Payment Methods not Showing for downloadable/virtual product when checkout?Magento2 API to access internal payment methodHow to call an existing payment methods in the registration form?