protected function _getLoadSelect($field, $value, $object) { $select = parent::_getLoadSelect($field, $value, $object); if (!is_null($this->childMode)) { $childTable = $this->getChildTable(); $select->join($childTable, "`{$childTable}`.`" . $this->getChildPrimary() . "` = `" . $this->getMainTable() . '`.`id`'); } return $select; }
protected function _afterSave(Mage_Core_Model_Abstract $object) { $result = parent::_afterSave($object); if (is_null($this->childMode)) { return $result; } $childData = $object->getData(); $childData[$this->getChildPrimary()] = (int) $object->getData('id'); unset($childData['id'], $childData['create_date'], $childData['update_date']); Mage::getModel($this->getChildModel())->addData($childData)->save(); return $result; }