Copys all data from a given address.

@param MShop_Common_Item_Address_Interface $address New address
543141
public function copyFrom( MShop_Common_Item_Address_Interface $address )
	{
		$this->setAddressId( $address->getId() );
		$this->setCompany( $address->getCompany() );
		$this->setVatID( $address->getVatID() );
		$this->setSalutation( $address->getSalutation() );
		$this->setTitle( $address->getTitle() );
		$this->setFirstname( $address->getFirstname() );
		$this->setLastname( $address->getLastname() );
		$this->setAddress1( $address->getAddress1() );
		$this->setAddress2( $address->getAddress2() );
		$this->setAddress3( $address->getAddress3() );
		$this->setPostal( $address->getPostal() );
		$this->setCity( $address->getCity() );
		$this->setState( $address->getState() );
		$this->setCountryId( $address->getCountryId() );
		$this->setTelephone( $address->getTelephone() );
		$this->setEmail( $address->getEmail() );
		$this->setTelefax( $address->getTelefax() );
		$this->setWebsite( $address->getWebsite() );
		$this->setLanguageId( $address->getLanguageId() );
		$this->setFlag( $address->getFlag() );

		$this->setModified();
	}
806118
public function setAddress($address)
    {
        if (is_object($address)) {
            $this->address = $address;
        } elseif (is_string($address) || is_array($address)) {
            $this->address = new Address($address);
        }
    }
590972
public function collect(Mage_Sales_Model_Quote_Address $address)
    {
        parent::collect($address);

        // Makes sure you only use the address type shipping
        $items = $this->_getAddressItems($address);
        if (!count($items)) {
            return $this;
        }

        // reset totals by default (needed for some external checkout modules)
        $address->setPaymentInstallmentFeeAmount(0);
        $address->setBasePaymentInstallmentFeeAmount(0);

        $quote = $address->getQuote();

        if ($address->getAllItems()) {
            $currentAmount = $address->getPaymentInstallmentFeeAmount();
            $payment = $quote->getPayment();

            if ($payment && !empty($payment)) {
                $paymentMethod = $quote->getPayment()->getMethod();

                if ($paymentMethod == "adyen_cc" || substr($paymentMethod, 0, 14) == 'adyen_oneclick') {
                    $info = $payment->getMethodInstance();

                    $instance = $info->getInfoInstance();
                    $numberOfInstallments = $instance->getAdditionalInformation('number_of_installments');

                    if ($numberOfInstallments > 0) {
                        // get the Interest Rate of this installment

                        // get cc type
                        $ccType = $instance->getCcType();

                        // get installment for this specific card type
                        $ccTypeInstallments = "installments_" . $ccType;

                        $all_installments = Mage::helper('adyen/installments')->getInstallments(
                            null,
                            $ccTypeInstallments
                        );
                        if (empty($all_installments)) {
                            // use default installments
                            $all_installments = Mage::helper('adyen/installments')->getInstallments();
                        }

                        $installmentKey = $numberOfInstallments - 1;
                        $installment = $all_installments[$installmentKey];

                        if ($installment != null && is_array($installment)) {
                            // check if interest rate is filled in
                            if (isset($installment[3]) && $installment[3] > 0) {
                                $this->_setAmount(0);
                                $this->_setBaseAmount(0);

                                $interestRate = $installment[3];
                                $baseGrandTotal = $address->getGrandTotal();
                                $fee = ($baseGrandTotal / 100) * $interestRate;

                                $balance = $fee - $currentAmount;

                                $address->setPaymentInstallmentFeeAmount($address->getQuote()->getStore()->convertPrice($balance));
                                $address->setBasePaymentInstallmentFeeAmount($balance);

                                $address->setGrandTotal($address->getGrandTotal() + $address->getPaymentInstallmentFeeAmount());
                                $address->setBaseGrandTotal($address->getBaseGrandTotal() + $address->getBasePaymentInstallmentFeeAmount());
                            }
                        }
                    }
                }
            }
        }

        return $this;
    }
278110
public function copyFrom( MShop_Service_Item_Interface $service )
	{
		$this->setCode( $service->getCode() );
		$this->setName( $service->getName() );
		$this->setType( $service->getType() );
		$this->setServiceId( $service->getId() );

		$items = $service->getRefItems( 'media', 'default', 'default' );
		if( ( $item = reset( $items ) ) !== false ) {
			$this->setMediaUrl( $item->getUrl() );
		}

		$this->setModified();
	}
325448
public function to($address, $name = null)
    {
        if (is_array($address)) {
            $this->addAddressArray($address, 'to');
        } else {
            $this->to[$address] = $name;
        }

        return $this;
    }
531444
public function addAddress($address)
    {
        if (!$this->getAddresses()) {
            return $this->setAddresses(array($address));
        } else {
            return $this->setAddresses(
                array_merge($this->getAddresses(), array($address))
            );
        }
    }
653903
public function deleteAddress( $domain = MShop_Order_Item_Base_Address_Abstract::TYPE_DELIVERY )
	{
		$this->_notifyListeners( 'deleteAddress.before', $domain );

		if( isset( $this->_addresses[$domain] ) ) {
			unset( $this->_addresses[$domain] );
			$this->_modified = true;
		}

		$this->_notifyListeners( 'deleteAddress.after', $domain );
	}
563712
public function addTo($address, $title = '')
    {
        array_push(
            $this->toAddresses,
            $this->formatEmailAddress($address, $title)
        );

        return $this;
    }
974769
public function setRecipient($address = null, $name = null)
    {
        try {
            $address = $this->idnToAscii($address);

            parent::addAddress($address, $name);

            // copying values as original class does not allow to access recipients array
            $this->_aRecipients[] = [$address, $name];
        } catch (Exception $exception) {
        }
    }
1167490
public function saveItem( MShop_Common_Item_Interface $item, $fetch = true )
	{
		if( $item->getId() !== null )
		{
			$actual = $this->_getManager()->getItem( $item->getId() );
			$siteId = $this->_getContext()->getLocale()->getSiteId();

			if( $actual->getSiteId() != $siteId ) {
				return;
			}
		}

		parent::saveItem( $item, $fetch );
	}
200485
protected function setAddress($address)
    {
        if (is_array($address)) {
            $new_address = [];

            foreach (['address', 'city', 'state', 'zip'] as $field) {
                if (array_key_exists($field, $address)) {
                    $new_address[] = $address[$field];
                }
            }

            $address = implode(' ', $new_address);
        }

        return $address;
    }
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;
    }
807146
public function cleanAddress($address)
    {
        $response = $this->query($this->prepareUri('clean/address'), [$address]);
        $result = $this->populate(new Address, $response);
        if (!$result instanceof Address) {
            throw new RuntimeException('Unexpected populate result: ' . get_class($result). '. Expected: ' . Address::class);
        }

        return $result;
    }
764753
public function address($address) {
        $response = $this->dataClient->get($this->converter->getUrlForAddress($address));
        return $this->converter->convertAddress($response->body());
    }
304856
public function addTo($address, $name = null)
    {
        $current = $this->getTo();
        $current[$address] = $name;

        return $this->setTo($current);
    }
32814
final public static function cropimage(string $address) {

        $w = getimagesize($address)[0];
        $h = getimagesize($address)[1];

        if ($w == $h)
            return;

        $img = WideImage::load($address);

        if ($w > $h)
            $cr = $img -> crop(floor(($w - $h)/2), 0, $h, $h);
        else $cr = $img -> crop(0, floor(($h - $w)/2), $w, $w);

        $cr -> saveToFile($address);

    }
435133
public function saveAddress(AddressInterface $address)
    {
        if ($address->getId()) {
            $addressToSave = clone $address;
            $addressToSave->setId(null);

            $this->addressObjectManager->refresh($address);
            $this->addressObjectManager->persist($addressToSave);
            $this->addressObjectManager->flush($addressToSave);

            $this->addressEventDispatcher->dispatchAddressOnCloneEvent(
                $address,
                $addressToSave
            );

            return $addressToSave;
        }

        $this
            ->addressObjectManager
            ->flush($address);

        return $address;
    }