Magento中非EAV Model继承自Mage_Core_Model_Abstract,需要实现_construct方法
先通过model的tag找到model的resource model的定义标签, 再从resource model的定义标签中找到对应的resource model名字。
非EAV ResourceModel继承自Mage_Core_Model_Mysql4_Abstract, 里面也需要实现
另外在Setup类中有 $this->getTable('xxx');
这里的参数是<table>标签中的表名。
ResourceModel中也有一个getTable方法,里面的参数是entity name。
protected function _construct(){
$this->_init('Model tag 名/ResourceModel tag名');
}
先通过model的tag找到model的resource model的定义标签, 再从resource model的定义标签中找到对应的resource model名字。
非EAV ResourceModel继承自Mage_Core_Model_Mysql4_Abstract, 里面也需要实现
protected function _construct(){
$this->_init('Model tag 名/ResourceModel tag名','表格主键列名');
}
另外在Setup类中有 $this->getTable('xxx');
这里的参数是<table>标签中的表名。
ResourceModel中也有一个getTable方法,里面的参数是entity name。