有人找到覆盖eav_resources的方法吗?特别是
Mage_Eav_Model_Resource_Entity_Attribute
感谢
您可以像重写任何其他资源模型一样重写eav/entity_attribute资源模型:
<global>
<models>
<eav_resource>
<rewrite>
<entity_attribute>Your_Module_Model_Eav_Resource_Entity_Attribute</entity_attribute>
</rewrite>
</eav_resource>
</models>
</global>
概念证明:
echo get_class(Mage::getResourceModel('eav/entity_attribute'));
正如@srgb所说,重写Mage_Catalog_Model_Resource_Attribute
_afterSave
方法,而不是parent::_afterSave
调用您的自定义模块资源类,该类将扩展Mage_Eav_Model_Resource_Entity_Attribute
。在这里,您可以覆盖_saveOption
方法。