class My_Module_Model_Order extends Mage_Core_Model_Abstract { protected function _afterSave() { $this->sendConfirmationEmail(); parent::_afterSave(); } private function sendConfirmationEmail() { // code to send confirmation email to customer } }
class My_Module_Model_Product extends Mage_Core_Model_Abstract { protected function _afterSave() { $this->updateInventory(); parent::_afterSave(); } private function updateInventory() { // code to update product inventory } }In this example, the `_afterSave` method in a custom module's `Product` class is overridden to update the inventory after a product is saved. The parent `_afterSave` method is called to ensure that other tasks are still executed. Package Library: Magento PHP Library.