mysql eav_Magento:覆盖/重写Mysql4和资源Eav集合类

本文介绍了一种在Magento中覆盖或重写Mysql4和Resource Eav集合类的方法,并提供了具体的配置XML代码示例。文中还提供了检查覆盖是否成功的方法。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Here is a tip to override/rewrite Mysql4 and Resource Eav collection class. I will only be including the config xml code. You can read more about Model Overriding over here: Magento: Model Controller Block Helper Override

By Mysql4 Collection Class, I mean like the following class:

Mage_Sales_Model_Mysql4_Order_Collection

Overriding Mysql4 Collection Class

1

2

3

4

5

6

7

8

9

MyNamespace_MyModule_Model_Sales_Mysql4_Order_Collection

By Resource Eav Collection Class, I mean like the following class:

Mage_Catalog_Model_Resource_Eav_Mysql4_Product_Collection

Overriding Resource Eav Collection Class

1

2

3

4

5

6

7

8

9

MyNamespace_MyModule_Model_Catalog_Resource_Eav_Mysql4_Product_Collection

Checking Class Name

After overriding, you can check the class name with the following code. This is useful to check if the overriding code is correct and working or not.

1

2

echo(get_class(Mage::getResourceModel('sales/order_collection')));

echo(get_class(Mage::getResourceModel('catalog/product_collection')));

Thanks.

Share this:

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值