/** * Before object save manipulations * * @return $this */ protected function _beforeSave() { parent::_beforeSave(); if (!$this->getParentId() && $this->getOrder()) { $this->setParentId($this->getOrder()->getId()); } // Init customer address id if customer address is assigned $customerData = $this->getCustomerAddressData(); if ($customerData) { $this->setCustomerAddressId($customerData->getId()); } return $this; }
/** * Initialize quote identifier before save * * @return $this */ protected function _beforeSave() { parent::_beforeSave(); $this->_populateBeforeSaveData(); return $this; }