Set customer address

@param  string  $type
@param  \Softpampa\Moip\Helpers\Address  $address
@return $this
483240
public function addAddress($type = self::ADDRESS_BILLING, Address $address)
    {
        $address->setContext(Moip::PAYMENT);
        $address = $address->getData();

        switch ($type) {
            case self::ADDRESS_BILLING:
                $this->data->billingAddress = $address;
                break;
            case self::ADDRESS_SHIPPING:
                $this->data->shippingAddress = $address;
                break;
            default:
                throw new UnexpectedValueException(sprintf('%s não é um tipo de endereço válido', $type));
        }

        return $this;
    }
1068200
protected function setGlobalAddress($mailer, array $config, $type)
    {
        $address = Arr::get($config, $type);

        if (is_array($address) && isset($address['address'])) {
            $mailer->{'always'.Str::studly($type)}($address['address'], $address['name']);
        }
    }
750815
protected function _addRecipient($type, $address, $name = null)
    {
        $classes = $this->_classes;
        $headers = $this->headers();
        if (!isset($headers[$type])) {
            $addresses = $classes['addresses'];
            $headers[$type] = new $addresses();
        }
        $class = $classes['address'];
        $value = new $class($address, $name);
        $headers[$type][] = $value;
        return $value;
    }
1125905
public function setReturnPath($address)
    {
        if (!$this->setHeaderFieldModel('Return-Path', $address)) {
            $this->getHeaders()->addPathHeader('Return-Path', $address);
        }

        return $this;
    }
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;
    }
408685
public function createAddress(Address $address, array $params = [])
    {
        $this->getClient()->createAccountAddress($this, $address, $params);
    }
575875
public function setReplyTo($address, $title = '')
    {
        $this->headers['Reply-To'] = $this->formatEmailAddress($address, $title);

        return $this;
    }
790554
public function addCC($address, $title = '')
    {
        if (!isset($this->headers['CC'])) {
            $this->headers['CC'] = array();
        }

        array_push(
            $this->headers['CC'],
            $this->formatEmailAddress($address, $title)
        );

        return $this;
    }
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;
    }
327604
public function setAddress(\Dacorp\ExtraBundle\Entity\Address $address = null)
    {
        $this->address = $address;
    
        return $this;
    }
659036
protected function saveDefaultAddressByType($type)
    {

        // load email and website ID
        $email     = $this->getValue(ColumnKeys::EMAIL);
        $websiteId = $this->getSubject()->getStoreWebsiteIdByCode($this->getValue(ColumnKeys::WEBSITE));

        // try to load the customer with the given email + website ID
        if ($customer = $this->getCustomerBunchProcessor()->loadCustomerByEmailAndWebsiteId($email, $websiteId)) {
            // initialize an empty address ID
            $addressId = null;

            // query whether or not we've a default shipping/billing address
            if ((integer) $this->getValue($type) === 1) {
                $addressId = $this->getSubject()->getLastEntityId();
            }

            // finally update the customer
            $this->getCustomerBunchProcessor()->persistCustomer(
                $this->mergeEntity(
                    $customer,
                    array(
                        $this->mapColumName($type) => $addressId,
                        MemberNames::UPDATED_AT    => $this->formatDate(date('Y-m-d H:i:s'))
                    )
                )
            );
        }
    }
1241523
protected function addAddresses($address, $name, $type)
    {
        if (is_array($address)) {
            $this->swift->{"set{$type}"}($address, $name);
        } else {
            $this->swift->{"add{$type}"}($address, $name);
        }

        return $this;
    }
632926
public function setAddressType($addressType)
    {
        if (!in_array($addressType,
            array(
                AF_INET,
                AF_INET6,
                AF_UNIX
            )
        )) {
            throw new \DomainException('Unsupported address type');
        }

        $this->addressType = $addressType;
        return $this;
    }
1327821
public function address($address = null)
    {
        if ($address !== null) {
            $this->address = str_replace('&amp;', '&', $address);
        }

        $this->setRedirectHeaders();

        return $this->address;
    }
998322
public function setBounce(Address $address): Email
    {
        $this->message->setReturnPath($address->getEmail(), $address->getName());

        return $this;
    }
206217
public function setAddressOrigin(\Core\Entity\Address $address_origin = null) {
        $this->address_origin = $address_origin;

        return $this;
    }
811591
protected function addAddresses($address, $name, $type)
    {
        if (is_array($address)) {
            $this->swiftMessage->{"set{$type}"}($address, $name);

            return $this;
        }

        $this->swiftMessage->{"add{$type}"}($address, $name);

        return $this;
    }