update the shipping address with the data passed.

Set new pack station type before validating

@param array $aAddress

@return bool
323815
protected function UpdateShippingAddress($aAddress)
    {
        $oUser = TdbDataExtranetUser::GetInstance();
        if ($oUser->DHLPackStationStatusChanged($aAddress)) {
            $aAddress = $oUser->fillPackStationFieldValue($aAddress);
            if (true === $this->isAddressBillingAddress($aAddress, $oUser) &&
                true === $this->isAddressPackstation($aAddress)
            ) {
                $this->getFlashMessage()->addMessage(
                    TdbDataExtranetUserAddress::FORM_DATA_NAME_SHIPPING,
                    'PkgShopDhlPackstation-ERROR-SHIPPING-IS-BILLING-MAY-NOT-BE-PACKSTATION'
                );

                return false;
            }
            $bUpdateOk = $oUser->UpdateShippingAddress($aAddress);
            $oShippingAddress = $oUser->GetShippingAddress();
            if ($oShippingAddress) {
                $bUpdateOk = $oShippingAddress->ValidateData(TdbDataExtranetUserAddress::FORM_DATA_NAME_SHIPPING);
            }
        } else {
            $bUpdateOk = parent::UpdateShippingAddress($aAddress);
        }

        return $bUpdateOk;
    }
451436
public function update( models\Call\ContactAddress $contactAddress){
        $rest = $this->getService( self::API_ADDRESS . $contactAddress->getId());
        $rest->PUT( $contactAddress);

        return $rest->getResult( models\Call\ContactAddress::class);
    }
727682
public function addAddress(AddressInterface $address)
    {
        if ($this->addresses->contains($address)) {
            throw new \InvalidArgumentException('This contact already owns this address');
        }

        $this->addresses->add($address);

        if (!$this->defaultAddress) {
            $this->setDefaultAddress($address);
        }
    }
124575
public function addEmailAddress(array $addresses = []): array
    {
        return $this->getApi()->request($this->getApi()->sprintf('/user/emails'), Request::METHOD_POST, $addresses);
    }
563435
public function updateFromEmbeddedApiResponse(array $data): CustomerInterface
    {
        // we cast to int because for some reason Dandomain can (sometimes) have customers where the id is not set
        // and instead of setting the id to 0, Dandomain sets it to ''
        $id = (int) $data['id'];

        $customer = $this->customerRepository->findOneByExternalId($id);
        if (!$customer) {
            $customer = new Customer();
            $customer->setExternalId($id);
        }

        $customer
            ->setAddress($data['address'])
            ->setAddress2($data['address2'])
            ->setAttention($data['attention'])
            ->setCity($data['city'])
            ->setCountry($data['country'])
            ->setCountryId($data['countryId'])
            ->setEan($data['ean'])
            ->setEmail($data['email'])
            ->setFax($data['fax'])
            ->setName($data['name'])
            ->setPhone($data['phone'])
            ->setState($data['state'])
            ->setZipCode($data['zipCode'])
        ;

        return $customer;
    }
32342
protected function ValidateBillingAddress($aAddress)
    {
        $bValid = parent::ValidateBillingAddress($aAddress);

        if ($bValid) {
            $oAddress = TdbDataExtranetUserAddress::GetNewInstance($aAddress);
            // make sure this is not a packstation
            if ($oAddress->fieldIsDhlPackstation) {
                $bValid = false;
                $oMsgManager = TCMSMessageManager::GetInstance();
                $oMsgManager->AddMessage(TdbDataExtranetUserAddress::FORM_DATA_NAME_BILLING, 'PkgShopDhlPackstation-ERROR-BILLING-MAY-NOT-BE-PACKSTATION');
            }
        }

        return $bValid;
    }
471707
protected function updateAddress($address_id)
    {
        if (!$this->isError() && !$this->address->update($address_id, $this->getSubmitted())) {
            $this->errorAndExit($this->text('Unexpected result'));
        }
    }
659252
protected function SetShipToBillingAddress($sShipToBillingAddress)
    {
        $bAllowChange = true;
        if ('1' == $sShipToBillingAddress) {
            if (TdbDataExtranetUserAddress::FORM_DATA_NAME_SHIPPING == $this->AddressUsedAsPrimaryAddress()) {
                if ('1' == $this->GetShippingAddressData('is_dhl_packstation')) {
                    $bAllowChange = false;
                    $oMsgManager = TCMSMessageManager::GetInstance();
                    $oMsgManager->AddMessage(TdbDataExtranetUserAddress::FORM_DATA_NAME_BILLING, 'PkgShopDhlPackstation-ERROR-BILLING-MAY-NOT-BE-PACKSTATION');
                }
            }
        }
        if ($bAllowChange) {
            parent::SetShipToBillingAddress($sShipToBillingAddress);
        }
    }
561332
protected function ValidateShippingAddress($aAddress)
    {
        $oAddress = TdbDataExtranetUserAddress::GetNewInstance($aAddress);

        return $oAddress->ValidateData(TdbDataExtranetUserAddress::FORM_DATA_NAME_SHIPPING);
    }
1194027
protected function hookChangedShippingAddress(
        TdbDataExtranetUserAddress $oOldAddress,
        TdbDataExtranetUserAddress $oNewAddress
    ) {
        if ($oOldAddress->fieldDataCountryId != $oNewAddress->fieldDataCountryId) {
            // trigger shipping country change
            $oEvent = TPkgShop_TPkgCmsEvent_ChangeShippingCountry::GetNewInstance(
                $this,
                TPkgShop_TPkgCmsEvent_ChangeShippingCountry::CONTEXT_PKG_SHOP,
                TPkgShop_TPkgCmsEvent_ChangeShippingCountry::NAME_USER_CHANGED_SHIPPING_COUNTRY,
                array('oOld' => $oOldAddress, 'oNew' => $oNewAddress)
            );
            TPkgCmsEventManager::GetInstance()->NotifyObservers($oEvent);
        }
    }
531181
public function updateAddress( CustomerVault\Address $address )
    {
        $address->setRequiredFields(array(
            'profileID',
            'id'
        ));
        $address->checkRequiredFields();
        $address->setRequiredFields(array('country'));
        $address->setOptionalFields(array(
            'nickName',
            'street',
            'street2',
            'city',
            'state',
            'zip',
            'recipientName',
            'phone',
            'defaultShippingAddressIndicator',
        ));

        $request = new Request(array(
            'method' => Request::PUT,
            'uri' => $this->prepareURI("/profiles/" . $address->profileID . "/addresses/" . $address->id),
            'body' => $address
        ));
        $response = $this->client->processRequest($request);
        $response['profileID'] = $address->profileID;

        return new CustomerVault\Address($response);
    }
137917
public function setLocalIpAddress($address)
    {
        if (!filter_var($address, FILTER_VALIDATE_IP)) {
            throw new \InvalidArgumentException('Invalid ip address');
        }

        $this->networkIpVersion = (strpos($address, ':') ===
                                   false) ? NetworkNodeInterface::IP_V4 : NetworkNodeInterface::IP_V6;
        $this->networkLocalIp = $address;
    }
1138726
protected function _assignAddress($aDelAddress)
    {
        if (is_array($aDelAddress) && count($aDelAddress)) {
            $sAddressId = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter('oxaddressid');
            $sAddressId = ($sAddressId === null || $sAddressId == -1 || $sAddressId == -2) ? null : $sAddressId;

            $oAddress = oxNew(\OxidEsales\Eshop\Application\Model\Address::class);
            $oAddress->setId($sAddressId);
            $oAddress->load($sAddressId);
            $oAddress->assign($aDelAddress);
            $oAddress->oxaddress__oxuserid = new \OxidEsales\Eshop\Core\Field($this->getId(), \OxidEsales\Eshop\Core\Field::T_RAW);
            $oAddress->oxaddress__oxcountry = $this->getUserCountry($oAddress->oxaddress__oxcountryid->value);
            $oAddress->save();

            // resetting addresses
            $this->_aAddresses = null;

            // saving delivery Address for later use
            Registry::getSession()->setVariable('deladrid', $oAddress->getId());
        } else {
            // resetting
            Registry::getSession()->setVariable('deladrid', null);
        }
    }
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);
        }
    }
447
public function setAddress($value)
    {
        if (is_array($value)) {
            $value = new Address($value);
        }
        return $this->setParameter('address', $value);
    }
403718
protected function convertAddressLineData($localAddressData, array $address)
    {
        if ('AT' == $address['CountryCode'] || 'DE' == $address['CountryCode']) {
            $addressLine1 = $address['AddressLine1'];
            $addressLine2 = $address['AddressLine2'];
            $addressLine3 = $address['AddressLine3'];
            $postBox = '';
            $company = '';
            $street = '';
            if ('' != $addressLine3) {
                $street = $addressLine3;
                if (true === is_numeric($addressLine1) ||
                    true === strstr($addressLine1.' '.$addressLine2, 'Packstation')
                ) {
                    $postBox = $addressLine1.' '.$addressLine2;
                } else {
                    $company = $addressLine1.' '.$addressLine2;
                }
            } else {
                if ('' != $addressLine2) {
                    $street = $addressLine2;
                    if (true === is_numeric($addressLine1) || true === strstr($addressLine1, 'Packstation')) {
                        $postBox = $addressLine1;
                    } else {
                        $company = $addressLine1;
                    }
                } else {
                    if ('' != $addressLine1) {
                        $street = $addressLine1;
                    }
                }
            }
            $localAddressData['company'] = $company;
            $localAddressData['address_additional_info'] = $postBox;
            $localAddressData['street'] = $street;
        }

        return $localAddressData;
    }
806118
public function setAddress($address)
    {
        if (is_object($address)) {
            $this->address = $address;
        } elseif (is_string($address) || is_array($address)) {
            $this->address = new Address($address);
        }
    }