且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

需要Magento模型的文档(Mage :: getModel())

更新时间:2023-11-30 10:31:16

您应该深入研究代码.使用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')