首页 > 代码库 > magento重写资源类型的models

magento重写资源类型的models

平常的model重写方式

<models>
<catalogsearch>
<rewrite>
<fulltext>Sanv_CatalogSearch_Model_Fulltext</fulltext>
</rewrite>
</catalogsearch_resource>
</models>

但是如果想复写catalogsearch model下resource目录下的东西,以这种方式就无法重写

错误的重写方式:
<catalogsearch>
<rewrite>
<resource_fulltext>Sanv_CatalogSearch_Model_Resource_Fulltext</resource_fulltext>
</rewrite>
</catalogsearch_resource>
</models>

正确的重写方式:
<models>
<catalogsearch_resource>
<rewrite>
<fulltext>Sanv_CatalogSearch_Model_Resource_Fulltext</fulltext>
</rewrite>
</catalogsearch_resource>
</models>

magento重写资源类型的models