Mass-assignment method for using a postal address.

@param \Hamjoint\Mustard\Commerce\PostalAddress $postalAddress
@return void
164854
public function useAddress(PostalAddress $postalAddress)
    {
        $this->name = $postalAddress->name;
        $this->street1 = $postalAddress->street1;
        $this->street2 = $postalAddress->street2;
        $this->city = $postalAddress->city;
        $this->county = $postalAddress->county;
        $this->postcode = $postalAddress->postcode;
        $this->country = $postalAddress->country;
    }
485793
public function setAddress3($address3)
	{
		if ( $address3 == $this->getAddress3() ) { return; }

		$this->_values['address3'] = (string) $address3;
		$this->setModified();
	}
561351
public function removeAddresse(\Sulu\Bundle\ContactBundle\Entity\Address $addresses)
    {
        $this->addresses->removeElement($addresses);
    }
723003
public function manageAddresses($mail)
    {
        $addresses = parent::manageAddresses($mail);

        if ($mail->getPositions() === null) {
            $mail->initPositions();
        }

        foreach ($mail->getPositions() as $position) {
            $name = sprintf(
                '%s %s', $position->getIndividual()->getFirstName(), $position->getIndividual()->getName()
            );

            if ($position->getEmail()) {
                $addresses[$position->getEmail()] = $name;
            } elseif ($position->getIndividual()->getEmail()) {
                $addresses[$position->getIndividual->getEmail()] = $name;
            } else {
                continue;
            }
        }

        if ($mail->getOrganisms() === null) {
            $mail->initOrganisms();
        }

        foreach ($mail->getOrganisms() as $organism) {
            if ($organism->getEmail()) {
                if ($organism->isIndividual()) {
                    $name = sprintf(
                        '%s %s', $organism->getFirstName(), $organism->getName()
                    );

                    $addresses[$organism->getEmail()] = $name;
                } else {
                    $addresses[$organism->getEmail()] = $organism->getName();
                }
            }
        }

        if ($mail->getCircles() === null) {
            $mail->initCircles();
        }

        foreach ($mail->getCircles() as $circle) {
            foreach ($circle->getOrganisms() as $organism) {
                if ($organism->isIndividual()) {
                    $name = sprintf(
                        '%s %s', $organism->getFirstName(), $organism->getName()
                    );

                    $addresses[$organism->getEmail()] = $name;
                } else {
                    $addresses[$organism->getEmail()] = $organism->getName();
                }
            }
        }

        return $addresses;
    }
848916
public function removeElectronicAddress(ElectronicAddress $electronicAddress)
    {
        $this->electronicAddresses->removeElement($electronicAddress);
        if ($electronicAddress === $this->primaryElectronicAddress) {
            $this->primaryElectronicAddress = null;
        }
    }
791547
public function convertAddressFromAmazonToLocal(array $address, $targetAddressType)
    {
        $mapping = array(
            'Name' => 'lastname',
            'AddressLine1' => 'company',
            'AddressLine2' => 'street',
            'AddressLine3' => 'address_additional_info',
            'County' => null,
            'District' => null,
            'StateOrRegion' => null,
            'City' => 'city',
            'PostalCode' => 'postalcode',
            'Phone' => 'telefon',
            'CountryCode' => 'data_country_id',
        );

        foreach (array_keys($address) as $field) {
            if (false === array_key_exists($field, $mapping)) {
                throw new InvalidArgumentException(
                    'invalid field '.$field.' (valid fields are: "'.implode(
                        '", "',
                        array_keys($mapping)
                    ).'")'
                );
            }
        }

        $target = array();
        foreach ($address as $field => $value) {
            if (null === $mapping[$field]) {
                continue;
            }
            if ('CountryCode' !== $field) {
                $target[$mapping[$field]] = $value;
            } else {
                $target[$mapping[$field]] = $this->getCountryIdFromAmazonCountryCode($value, $targetAddressType);
            }
        }
        $target = $this->convertAddressLineData($target, $address);

        return $target;
    }
275658
public function setAddressDestination(\Core\Entity\Address $address_destination = null) {
        $this->address_destination = $address_destination;

        return $this;
    }
684856
public function setDeliveryAddressInfo(Address $address)
    {
        $this->setDeliveryAddress($address->getAddress());
        $this->setDeliveryPostalCode($address->getPostalCode());
        $this->setDeliveryCity($address->getCity());
        $this->setDeliveryState($address->getState());
        $this->setDeliveryCountry($address->getCountry());
    }
660517
private function setEmailAddress(?string $emailAddress): self
    {
        $this->updatePropertyValue(
            EmailAddressFieldInterface::PROP_EMAIL_ADDRESS,
            $emailAddress
        );

        return $this;
    }
301642
public function geocode( $postal_code ) {
    // Setup local variable for holding results from geocoder.
    $addressCollection = null;

    // Try to call the geocoder.
    try {
      // Set it call to geocoder...
      $curl     = new \Ivory\HttpAdapter\CurlHttpAdapter();
      $geocoder = new \Geocoder\Provider\GoogleMaps( $curl, null, null, true );

      // Geocode the zipcode...
      $addressCollection = $geocoder->geocode( $postal_code );
    } catch ( \Exception $exception ) {
      // Recover from exception by rethrowing wrapped in GeocodingException.
      throw new GeocodingException( 'An exception occurred during geocoding.', 0, $exception );
    }

    // Make sure geocode found at least one result.
    if ( ! $addressCollection->has( 0 ) ) {
      throw new GeocodingException( 'ZIP code geocode did not return any results: ' . $postal_code );
    }

    // Store first result in local variable.
    $address = $addressCollection->get( 0 );

    // Return result.
    return new LatLon( $address->getLatitude(), $address->getLongitude() );
  }
645973
public function setForeignAddress(\AgentSIB\Diadoc\Api\Proto\ForeignAddress $value = null)
    {
        $this->ForeignAddress = $value;
    }
838973
protected function setAddress(Address $address, $addressKey)
    {
        if (!$address->id) {
            $addressResource = $this->client
                ->addresses()
                ->create($address->asArray());

            if ($addressResource) {
                $address = $addressResource;
            }
        }

        $this->updateParams["{$addressKey}Id"] = $address->id;
    }
1159924
protected function sendEmail(MailerInterface $mailer, $address)
    {
        $message = $mailer->compose();
        $message->setTextBody(file_get_contents($this->_output))
            ->setSubject($this->getEmailSubject())
            ->setTo($address);

        $message->send();
    }
780509
public void setAddress(String street_1, String street_2, String city, String postal_code, String state, String country)
    {
        this.address.put("street_1", street_1);
        this.address.put("street_2", street_2);
        this.address.put("city", city);
        this.address.put("postal_code", postal_code);
        this.address.put("state", state);
        this.address.put("country", country);
    }
725379
private function setPostalArea(string $postalArea): AddressEmbeddableInterface
    {
        $this->notifyEmbeddablePrefixedProperties(
            'postalArea',
            $this->postalArea,
            $postalArea
        );
        $this->postalArea = $postalArea;

        return $this;
    }
303537
public function setClientAddress($clientAddress)
    {
        $clientAddress = (string) $clientAddress;
        if ($clientAddress === '') {
            throw new \InvalidArgumentException('$clientAddress cannot be empty');
        }

        $this->clientAddress = $clientAddress;
    }
471707
protected function updateAddress($address_id)
    {
        if (!$this->isError() && !$this->address->update($address_id, $this->getSubmitted())) {
            $this->errorAndExit($this->text('Unexpected result'));
        }
    }