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;
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
add a comment |
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
this is helpful to you.
– tokey
Jun 11 at 2:21
Have checkedMagentoFrameworkEntityManagerMetadataPool::getMetadata($entityType)
, but cannot find the culprit. Plez check updated question.
– Adarsh Khatri
Jun 11 at 2:46
add a comment |
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
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
magento2
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 checkedMagentoFrameworkEntityManagerMetadataPool::getMetadata($entityType)
, but cannot find the culprit. Plez check updated question.
– Adarsh Khatri
Jun 11 at 2:46
add a comment |
this is helpful to you.
– tokey
Jun 11 at 2:21
Have checkedMagentoFrameworkEntityManagerMetadataPool::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
add a comment |
2 Answers
2
active
oldest
votes
<!-- 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>
This doesn't help.
– Adarsh Khatri
Jun 11 at 5:11
add a comment |
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.
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
<!-- 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>
This doesn't help.
– Adarsh Khatri
Jun 11 at 5:11
add a comment |
<!-- 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>
This doesn't help.
– Adarsh Khatri
Jun 11 at 5:11
add a comment |
<!-- 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>
<!-- 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>
answered Jun 11 at 3:48
tokeytokey
862
862
This doesn't help.
– Adarsh Khatri
Jun 11 at 5:11
add a comment |
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
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Jun 12 at 1:47
Adarsh KhatriAdarsh Khatri
6,76011744
6,76011744
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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