Mage Coreのどこで製品のステータスセットですか?
質問
マゼントのステータスをどのように設定するかを変更するためにコアを拡張しようとしています。基本的に、管理者が製品のステータスを無効に変更しようとすると、製品がEPOSシステムで在庫があるかどうかを確認したいと思います。
これを行うために、私は製品のステータスが設定されているモデルを拡張し、その機能を書き直すつもりでした。問題は、どこにも見つけることができません。magento_core_model_productには何もありません。UpdateProductStatusというMAGE_CATALOG_MODEL_PRODUCT_STATUSで関数が見つかりましたが、これは正しいようです。
誰もがこの関数を見つけることを探しているのかを知っていますか?
解決
After a bit of research, I found that Magento generates all the getters and setters pragmatically, through extensive use of the __call()
function, which is called when a function that isn't defined is called.
To modify functionality of a getter or setter, simply define the function you want to modify in your rewrite of the class, and this will be called before the __call()
, essentially rewriting the default functionality, in a roundabout way.