*/ class Mage_Sales_Model_Resource_Order_Invoice_Attribute_Backend_Order extends Mage_Eav_Model_Entity_Attribute_Backend_Abstract { /** * Method is invoked before save * * @param Varien_Object $object * @return Mage_Sales_Model_Resource_Order_Invoice_Attribute_Backend_Order */ public function beforeSave($object) { if ($object->getOrder()) { $object->setOrderId($object->getOrder()->getId()); $object->setBillingAddressId($object->getOrder()->getBillingAddress()->getId()); } return parent::beforeSave($object); } }