/** * @param ContactAddress $contactAddress */ public function prepareAddress(ContactAddress $contactAddress) { // at this point imported address region have code equal to region_id in magento db field $mageRegionId = $contactAddress->getRegion() ? $contactAddress->getRegion()->getCode() : null; $contactAddress->setId(null); $this->addressImportHelper->updateAddressCountryRegion($contactAddress, $mageRegionId); $this->addressImportHelper->updateAddressTypes($contactAddress); }
/** * @param AbstractAddress $address * @param int $mageRegionId * * @return $this */ protected function updateAddressCountryRegion(AbstractAddress $address, $mageRegionId) { $this->addressHelper->updateAddressCountryRegion($address, $mageRegionId); return $this; }