需要Magento模型的文档(Mage :: getModel()) [英] Need documentation for Magento Models (Mage::getModel())

查看:59
本文介绍了需要Magento模型的文档(Mage :: getModel())的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已阅读Alan Storm的指南

I've read Alan Storm's guide here on Magento ORM principles and how to access the data. I'm writing a plugin to export data from magento.

问题

在哪里可以找到Magento中可用的不同类型模型的文档?

Where do I find documentation for the different types of models available in Magento?

例如

Mage::getModel("catalog/categories");

getModel中还可以使用哪些其他模型?

What are the other allowable models in getModel?.

API文档中有一些信息,例如product.list,如果我猜的话,那么我会说这是如何转换为getModel调用的,但是我不确定如何转换.谁能链接我? google搜索"getModel文档",然后 "Magento模型"未产生任何相关结果.

There's some information in the API documentation, like product.list, and if I were to guess, then I would say that this some how translates over to the getModel call, but i'm not sure how. Can anyone link me? google searches for "getModel documentation" and "Magento models" produce no relevant results.

这是我看过的链接:

  1. 数据库关系图
  2. SO问题
  3. getModel和getData方法
  4. 艾伦·斯托姆的指南
  1. DB Diagram
  2. SO Question
  3. getModel and getData methods
  4. Alan Storm's guide

到目前为止,Alan的工作最有帮助. 帮帮我@Alan Storm:)

So far, Alan's stuff has been the most helpful. Help me, @Alan Storm :)

推荐答案

您应该深入研究代码.使用getModel,您可以获取位于Models目录中的每个模块的每个类的实例.在catalog/product_option_a_b_c表达式中,最合适的部分(catalog)引用模块,第二部分引用catalog模块的Models目录中的Product/Option/A/B/C.php文件.因此,如果要获取Mage_Sales_Model_Quote_Address类的实例,则需要:Mage::getModel('sales/quote_address')

You should dig into code. Using getModel you're able to get an instance of each class of each module which is located in Models directories. In catalog/product_option_a_b_c expression, the fitst part (catalog) references to module and the second part references to Product/Option/A/B/C.php file in the Models directory of catalog module. So if you want to get an instance of Mage_Sales_Model_Quote_Address class, you need this: Mage::getModel('sales/quote_address')

这篇关于需要Magento模型的文档(Mage :: getModel())的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆