Copies address data to order address.

@param OrderAddressInterface $orderAddress
@param array $addressData
178991
private function setAddressDataForOrder(&$orderAddress, $addressData)
    {
        $orderAddress->setStreet($this->getProperty($addressData, 'street', ''));
        $orderAddress->setNumber($this->getProperty($addressData, 'number', ''));
        $orderAddress->setAddition($this->getProperty($addressData, 'addition', ''));
        $orderAddress->setCity($this->getProperty($addressData, 'city', ''));
        $orderAddress->setZip($this->getProperty($addressData, 'zip', ''));
        $orderAddress->setState($this->getProperty($addressData, 'state', ''));

        $countryName = $this->getProperty($addressData, 'country', '');
        // Get country name if country is an array.
        if (is_array($countryName)) {
            $countryName = '';
            if (isset($countryName['name'])) {
                $countryName = $countryName['name'];
            }
        }
        $orderAddress->setCountry($countryName);
        $orderAddress->setEmail($this->getProperty($addressData, 'email', ''));
        $orderAddress->setPhone($this->getProperty($addressData, 'phone', ''));
        $orderAddress->setNote($this->getProperty($addressData, 'note', ''));

        $orderAddress->setPostboxCity($this->getProperty($addressData, 'postboxCity', ''));
        $orderAddress->setPostboxPostcode($this->getProperty($addressData, 'postboxPostcode', ''));
        $orderAddress->setPostboxNumber($this->getProperty($addressData, 'postboxNumber', ''));

        $address = null;
        if ($this->getProperty($addressData, 'address')) {
            $address = $this->getProperty($addressData, 'address');
        } elseif ($this->getProperty($addressData, 'contactAddress')) {
            $address = $this->getProperty($addressData, 'contactAddress');
        }
        if ($address) {
            $this->getAndSetOrderAddressByContactAddressId($address, null, null, $orderAddress);
        }
    }
471707
protected function updateAddress($address_id)
    {
        if (!$this->isError() && !$this->address->update($address_id, $this->getSubmitted())) {
            $this->errorAndExit($this->text('Unexpected result'));
        }
    }
1214422
public function setOrderData($orderData)
    {
        $this->id = $orderData->getIncrementId();
        $this->email = $orderData->getCustomerEmail();
        $this->quoteId = $orderData->getQuoteId();
        $this->storeName = $orderData->getStoreName();
        $this->purchaseDate = $orderData->getCreatedAt();
        $this->deliveryMethod = $orderData->getShippingDescription();
        $this->deliveryTotal = (float)number_format(
            $orderData->getShippingAmount(),
            2,
            '.',
            ''
        );
        $this->currency = $orderData->getStoreCurrencyCode();
        $payment = $orderData->getPayment();

        if ($payment) {
            if ($payment->getMethod()) {
                $methodInstance = $payment->getMethodInstance($payment->getMethod());
                if ($methodInstance) {
                    $this->payment = $methodInstance->getTitle();
                }
            }
        }

        $this->couponCode = $orderData->getCouponCode();

        /*
         * custom order attributes
         */
        $website = $this->_storeManager->getStore($orderData->getStore())->getWebsite();

        $customAttributes
            = $this->helper->getConfigSelectedCustomOrderAttributes(
                $website
            );

        if ($customAttributes) {
            $fields = $this->helper->getOrderTableDescription();
            $this->custom = [];
            foreach ($customAttributes as $customAttribute) {
                if (isset($fields[$customAttribute])) {
                    $field = $fields[$customAttribute];
                    $value = $this->_getCustomAttributeValue(
                        $field,
                        $orderData
                    );
                    if ($value) {
                        $this->_assignCustom($field, $value);
                    }
                }
            }
        }

        /*
         * Billing address.
         */
        $this->processBillingAddress($orderData);

        /*
         * Shipping address.
         */
        $this->processShippingAddress($orderData);

        $syncCustomOption = $this->helper->getWebsiteConfig(
            \Dotdigitalgroup\Email\Helper\Config::XML_PATH_CONNECTOR_SYNC_ORDER_PRODUCT_CUSTOM_OPTIONS,
            $website
        );

        /*
         * Order items.
         */
        $this->processOrderItems($orderData, $syncCustomOption);

        $this->orderSubtotal = (float)number_format(
            $orderData->getData('subtotal'),
            2,
            '.',
            ''
        );
        $this->discountAmount = (float)number_format(
            $orderData->getData('discount_amount'),
            2,
            '.',
            ''
        );
        $orderTotal = abs(
            $orderData->getData('grand_total') - $orderData->getTotalRefunded()
        );
        $this->orderTotal = (float)number_format($orderTotal, 2, '.', '');
        $this->orderStatus = $orderData->getStatus();

        unset($this->_storeManager);

        return $this;
    }
213586
protected function applyOrderBy(array $data, $orderBy)
    {
        if (!empty($orderBy)) {
            ArrayHelper::multisort($data, array_keys($orderBy), array_values($orderBy));
        }

        return $data;
    }
1000317
public function setEmailAddress($emailAddress)
    {
        if ($emailAddress != null)
        {
            if (filter_var(trim($emailAddress), FILTER_VALIDATE_EMAIL) === false)
            {
                throw new InvalidArgumentException($emailAddress . " is not a valid email address.");
            }
        }

        $this->emailAddress = $emailAddress;
    }
1316307
private void setAddress(Address address, RolodexContract rolodex) {
        if (rolodex != null) {
            address.setStreet1(rolodex.getAddressLine1());
            address.setStreet2(rolodex.getAddressLine2());
            address.setCity(checkNull(rolodex.getCity()));
            address.setCounty(rolodex.getCounty());
            address.setState(rolodex.getState());
            address.setZipCode(rolodex.getPostalCode());
            if (rolodex.getCountryCode() != null) {
                CountryCodeType.Enum country = CountryCodeType.Enum.forString(rolodex.getCountryCode());
                address.setCountry(country);
            }
        }else {
            address.setStreet1("");
            address.setCity("");
        }
    }
250882
private function setAddress($quoteAddress, $address)
    {
        $address = $this->cartHelper->handleSpecialAddressCases($address);

        $region = $this->regionModel->loadByName(@$address->region, @$address->country_code);

        $addressData = [
            'firstname'    => @$address->first_name,
            'lastname'     => @$address->last_name,
            'street'       => trim(@$address->street_address1 . "\n" . @$address->street_address2),
            'city'         => @$address->locality,
            'country_id'   => @$address->country_code,
            'region'       => @$address->region,
            'postcode'     => @$address->postal_code,
            'telephone'    => @$address->phone_number,
            'region_id'    => $region ? $region->getId() : null,
            'company'      => @$address->company,
        ];

        if ($this->cartHelper->validateEmail(@$address->email_address)) {
            $addressData['email'] = $address->email_address;
        }

        // discard empty address fields
        foreach ($addressData as $key => $value) {
            if (empty($value)) {
                unset($addressData[$key]);
            }
        }

        $quoteAddress->setShouldIgnoreValidation(true);
        $quoteAddress->addData($addressData)->save();
    }
642277
public static function create(object $googleData) : Address
    {
        $build = new self($googleData);
        $address = $build->createAddressFromComponents();

        return $address;
    }
179849
@Override
	public void cacheResult(List<CommerceAddress> commerceAddresses) {
		for (CommerceAddress commerceAddress : commerceAddresses) {
			if (entityCache.getResult(
						CommerceAddressModelImpl.ENTITY_CACHE_ENABLED,
						CommerceAddressImpl.class,
						commerceAddress.getPrimaryKey()) == null) {
				cacheResult(commerceAddress);
			}
			else {
				commerceAddress.resetOriginalValues();
			}
		}
	}
1323642
public function addressToCoordinates(array $addressData = [])
	{
		$this->returnLocationData = array_merge($this->returnLocationData, array_only($addressData, ['country', 'region', 'city', 'street', 'street_number']));
		return $this;
	}
120304
public function copyValuesFromInterface(OrderAddressInterface $from, OrderAddressInterface $to)
    {
        // account
        $to->setAccountName($from->getAccountName());
        $to->setUid($from->getUid());
        // contact
        $to->setTitle($from->getTitle());
        $to->setSalutation($from->getSalutation());
        $to->setFirstName($from->getFirstName());
        $to->setLastName($from->getLastName());
        $to->setEmail($from->getEmail());
        $to->setPhone($from->getPhone());
        $to->setPhoneMobile($from->getPhoneMobile());
        // address
        $to->setStreet($from->getStreet());
        $to->setNumber($from->getNumber());
        $to->setAddition($from->getAddition());
        $to->setZip($from->getZip());
        $to->setCity($from->getCity());
        $to->setState($from->getState());
        $to->setCountry($from->getCountry());
        $to->setContactAddress($from->getContactAddress());
        $to->setNote($from->getNote());
        // postbox
        $to->setPostboxCity($from->getPostboxCity());
        $to->setPostboxNumber($from->getPostboxNumber());
        $to->setPostboxPostcode($from->getPostboxPostcode());
    }
161815
@Override
	public void cacheResult(CommerceAddress commerceAddress) {
		entityCache.putResult(CommerceAddressModelImpl.ENTITY_CACHE_ENABLED,
			CommerceAddressImpl.class, commerceAddress.getPrimaryKey(),
			commerceAddress);

		commerceAddress.resetOriginalValues();
	}
1219097
public static function addCacheTagsByAddressRecords(array $addressRecords)
    {
        $prefix = 'tt_address_';
        $cacheTags = [];
        foreach ($addressRecords as $addressRecord) {
            if (!$addressRecord instanceof Address) {
                continue;
            }
            // cache tag for each addressRecord record
            $cacheTags[] = $prefix . $addressRecord->getUid();

            if ($addressRecord->_getProperty('_localizedUid') != $addressRecord->getUid()) {
                $cacheTags[] = $prefix . $addressRecord->_getProperty('_localizedUid');
            }
        }

        $GLOBALS['TSFE']->addCacheTags($cacheTags);
    }
467524
private function processShippingAddress($orderData)
    {
        if ($orderData->getShippingAddress()) {
            $shippingData = $orderData->getShippingAddress()->getData();

            $this->deliveryAddress = [
                'delivery_address_1' => $this->_getStreet(
                    $shippingData['street'],
                    1
                ),
                'delivery_address_2' => $this->_getStreet(
                    $shippingData['street'],
                    2
                ),
                'delivery_city' => $shippingData['city'],
                'delivery_region' => $shippingData['region'],
                'delivery_country' => $shippingData['country_id'],
                'delivery_postcode' => $shippingData['postcode'],
            ];
        }
    }
895291
public function setAddressAddOn($addressAddOn): Hybrid
    {
        self::validateSetLength('addressAddOn', $addressAddOn);
        $this->data['addressAddOn'] = $addressAddOn;

        return $this;
    }
524070
private function cleanAddress($address, $updatableFields)
    {
        if (is_array($address)) {
            /** @var UpdatableFieldsConstructor $updatableFieldsConstructor */
            $updatableFieldsConstructor = oxNew(UpdatableFieldsConstructor::class);
            $cleaner = $updatableFieldsConstructor->getAllowedFieldsCleaner($updatableFields);
            return $cleaner->filterByUpdatableFields($address);
        }

        return $address;
    }
528733
public function setAddress($address)
    {
        if (null === $address) {
            $this->address = null;
        } elseif ('' == $address) {
            $this->address = '';
        } else {
            $this->assertValidAddress($address);
            $this->address = $address;
        }
        $this->setCachedValue(null);
    }