0
A
回答
6
您可以重寫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'));
0
正如@srgb說,覆蓋Mage_Catalog_Model_Resource_Attribute
_afterSave
方法,而不是parent::_afterSave
調用您的自定義模塊資源類小時將延長Mage_Eav_Model_Resource_Entity_Attribute
。在這裏,您可以覆蓋_saveOption
方法。
相關問題
- 1. Magento的覆蓋客戶資源模型
- 2. 覆蓋資源
- 3. 覆蓋資源
- 4. WPF資源覆蓋
- 5. 覆蓋Magento的類
- 6. 如何覆蓋原生資源?
- 7. 如何覆蓋資源包屬性
- 8. WP7:如何覆蓋靜態資源?
- 9. 如何從覆蓋資源文件
- 10. 覆蓋資源引擎
- 11. 資源在Android中覆蓋
- 12. 覆蓋資源控制器
- 13. JUnit彈簧資源覆蓋
- 14. 如何覆蓋資源類中的equals()方法?
- 15. Magento 1.7覆蓋PDF類
- 16. 如何覆蓋magento函數?
- 17. Magento:如何覆蓋Mage_Core_Controller_Front_Action
- 18. Magento的覆蓋模型資源目錄樹文件
- 19. 安全地覆蓋Magento核心資源方法
- 20. Magento - 覆蓋塊
- 21. 覆蓋Customer_Block_Form_Login Magento
- 22. 覆蓋Magento Mage_Sales_Model_Order_Invoice_Total_Subtotal
- 23. Magento - 覆蓋「OnepageController.php」
- 24. Magento:覆蓋Mage_CatalogSearch_Model_Resource_Helper_Mysql4
- 25. SBT:如何覆蓋默認來源(和/或資源等)?
- 26. Magento覆蓋現有源模型
- 27. 在maven戰爭覆蓋期間覆蓋資源
- 28. 如何覆蓋已覆蓋的類
- 29. Magento EAV:什麼是'源'設置用於?
- 30. 僅當資源顯示爲列表時如何覆蓋顯示的資源URI?
嘿,謝謝 - 完全是這樣,但發現我的覆蓋不起作用的原因是因爲有問題的方法是從一個子類調用 - 在這種情況下Mage_Catalog_Model_Resource_Attribute。 – srgb 2012-02-13 16:08:55
所以任何想要點擊屬性選項保存的人都應該查找Mage_Catalog_Model_Resource_Attribute :: _ afterSave,而不是Mage_Eav_Model_Resource_Entity_Attribute :: _ saveOption – srgb 2012-02-13 16:15:49