English 中文(简体)
1. 在Magento 1.5.x中建立模型
原标题:Setting up a model in magento 1.5.x

I can successfully do getModel(module/licenses) but then when I load($id) things break.

My database table is setup fine called licenses.

my config file has in the global -> modules tag

<modulename>
  <class>NameSpace_Module_Model></class>
  <resourceModel>module_mysql4</resourceModel>
</modulename>
<modulename_mysql4>
  <class>NameSpace_Module_Model_Mysql4</class>
  <entities>
    <licenses>
      <table>licenses</table>
    </licenses>
  </entities>
</modulename_mysql4>

然后,我有一份档案存放在我的模型/镜头上。 网址:<代码> 姓名 Mage_Core_Model_Abstract , 并包括一个星体功能,该功能为$this->_init(模块/执照)

我在模型/Mysql4/Licenses的模块中也有一个档案。 php with the category Namespace_Module_Model_Mysql4_Model_Licenses Expansion Mage_Core_Model_Mysql4_Abstract with a Constructionor which do $this->_init(模块/licenses , main here ) 这一类别似乎从未出现过,因为我增加了一次从来似乎从未运行的“var”撤离。

So I can get my model and dump it onto the screen but if I do a load($id) things die without warning in any log files. If I run it in a try catch i still get nothing. If I run a ->getResource() instead in a try catch and dump out the exception it gives a message that Mage registry key "_resource_singleton/module/licenses" already exists.

因此,如何适当设定表格的模型?

问题回答

是的,

现有的“资源——岛屿/城市/领土”关键分类登记处已经存在。

始终表明,你已挖出资源Model config node。





相关问题
Magento addFieldToFilter allow NULLs

When using the Magento collection method addFieldToFilter is it possible to allow filtering by NULL values? I want to select all the products in a collection that have a custom attribute even if no ...

Get product link from Magento API

I am new to Magento and using their API. I need to be able to get the product url from the API call. I see that I can access the url_key and url_path, but unfortunately that s not necessarily what ...

magento extension installation

I want to install a Magento extension in WAMP, but not from the Magento connect system. How can I do this? I have the module (extension) code and I already installed the sample data in the Magento ...

Link to a specific step in onepage checkout

Is it possible to redirect the browser to nth step in the onepage checkout? If so, how would one go about doing it? I m working on a payment module and have a sort of "cancel" action that i would ...

How do I filter a collection by a YesNo type attribute?

I have a ‘featured’ attribute, which has a Yes/No select-list as the admin input. I presume that the values for Yes and No are 1 and 0, as they are for every other Yes/No list. However, if I try and ...

热门标签