*/ class Mage_Sales_Model_Resource_Order_Creditmemo_Attribute_Backend_Child extends Mage_Eav_Model_Entity_Attribute_Backend_Abstract { /** * Method is invoked before save * * @param Varien_Object $object * @return Mage_Eav_Model_Entity_Attribute_Backend_Abstract */ public function beforeSave($object) { if ($object->getCreditmemo()) { $object->setParentId($object->getCreditmemo()->getId()); } return parent::beforeSave($object); } }