Create a new OrderAdress.

@example
$order = Subbly\Model\OrderAddress;
Subbly::api('subbly.orderadress')->create($order, $address);

@param \Subbly\Model\OrderAdress|array $orderAddress

@return \Subbly\Model\OrderAddress

@api
482188
public function create($address)
    {
        if (is_array($address)) {
            $address = new OrderAddress($address);
        }

        if ($address instanceof OrderAddress) {
            if ($this->fireEvent('creating', array($address)) === false) {
                return false;
            }

            $address->setCaller($this);
            $address->save();

            $this->fireEvent('created', array($address));

            $address = $this->find($address->id);

            return $address;
        }

        throw new Exception(sprintf(Exception::CANT_CREATE_MODEL,
            'Subbly\\Model\\Order',
            $this->name()
        ));
    }
931151
public function addaddress()
    {
        $form = $this->getOwner()->AddressForm();
        $member = Security::getCurrentUser();

        $form
            ->Fields()
            ->dataFieldByName("ContactID")
            ->setValue($member->Contact()->ID);

        $this
            ->getOwner()
            ->customise([
                "Title" => _t(
                    "SilverCommerce\ContactAdmin.AddAddress",
                    "Add Address"
                ),
                "MetaTitle" => _t(
                    "SilverCommerce\ContactAdmin.AddAddress",
                    "Add Address"
                ),
                "Form" => $form
            ]);

        $this->getOwner()->extend("updateAddAddress");

        return $this
            ->getOwner()
            ->renderWith([
                'AccountController_addaddress',
                AccountController::class . '_addaddress',
                'AccountController',
                AccountController::class,
                'Page'
            ]);
    }
1239452
protected function addAddress()
    {
        if (!$this->isError()) {

            $id = $this->address->add($this->getSubmitted());

            if (empty($id)) {
                $this->errorAndExit($this->text('Unexpected result'));
            }

            $this->line($id);
        }
    }
383466
public function replaceOrderAddressWithCustomerAddress(string $orderAddressId, string $customerAddressId, Context $context): JsonResponse
    {
        $this->recalculationService->replaceOrderAddressWithCustomerAddress($orderAddressId, $customerAddressId, $context);

        return new JsonResponse(null, Response::HTTP_NO_CONTENT);
    }
709934
protected function getShippingAddress(TdbShopOrder $order, $cachingEnabled, IMapperCacheTriggerRestricted $cacheTriggerManager)
    {
        if ($order->fieldAdrShippingUseBilling) {
            return $this->getBillingAddress($order, $cachingEnabled, $cacheTriggerManager);
        }
        $salutation = $order->GetFieldAdrShippingSalutation();
        if ($salutation && $cachingEnabled) {
            $cacheTriggerManager->addTrigger($salutation->table, $salutation->id);
        }
        $address = '';
        $address .= (null !== $salutation) ? $salutation->GetName().' ' : '';
        $address .= $this->getValueOrDefault($order->fieldAdrShippingFirstname, ' ');
        $address .= $this->getValueOrDefault($order->fieldAdrShippingLastname, ', ');
        $address .= $this->getValueOrDefault($order->fieldAdrShippingAdditionalInfo, ', ');
        $address .= $this->getValueOrDefault($order->fieldAdrShippingStreet, ' ');
        $address .= $this->getValueOrDefault($order->fieldAdrShippingStreetnr, ', ');
        $address .= $this->getValueOrDefault($order->fieldAdrShippingPostalcode, ' ');
        $address .= $this->getValueOrDefault($order->fieldAdrShippingCity);

        return $address;
    }
898630
public function setToAddress($emailAddress)
    {
        if (filter_var($emailAddress, FILTER_VALIDATE_EMAIL) !== $emailAddress) {
            throw new \InvalidArgumentException('Invalid email address: '.$emailAddress);
        }
        $this->toAddress = $emailAddress;
    }
494021
public function addProxyAddress($address)
    {
        $addresses = $this->getProxyAddresses();

        $addresses[] = $address;

        return $this->setAttribute($this->schema->proxyAddresses(), $addresses);
    }
1305657
private function joinAddress($addressType = 'billing')
    {
        $tableAlias = $addressType . '_address';

        $attributes = [];
        foreach ($this->addressFields as $addressConstantKey => $addressField) {
            $attributes[$addressType . '.' . $addressField] = $addressField;
        }

        $this->customerCollection->joinTable(
            [$tableAlias => $this->customerAddressEntityTable],
            'entity_id = default_' . $addressType,
            $attributes,
            null,
            'left'
        );

        return $this;
    }
549987
private function setAddress($address) {

        if(!$this->formatter) {
            $this->formatter = new StringFormatter();
        }

        $this->address = trim($this->formatter->format($address, '%S %n %z %L %C'));

        return $this;
    }
194339
public function addaddress()
    {
        $form = $this->AddressForm();
        $form
            ->Fields()
            ->dataFieldByName("OwnerID")
            ->setValue(Member::currentuserID());

        return $this
            ->owner
            ->customise(array(
                "ClassName" => "AccountPage",
                "Title"     => _t("Checkout.AddAddress", "Add Address"),
                "Form"  => $form
            ))->renderWith(array(
                "UserAccount_addaddress",
                "Users",
                "Page"
            ));
    }
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;
    }
1171548
public function setFromAddress($emailAddress)
    {
        if (filter_var($emailAddress, FILTER_VALIDATE_EMAIL) !== $emailAddress) {
            throw new \InvalidArgumentException('Invalid email address: '.$emailAddress);
        }
        $this->fromAddress = $emailAddress;
    }
903524
public function addAddresse(\Sulu\Bundle\ContactBundle\Entity\Address $addresses)
    {
        $this->addresses[] = $addresses;

        return $this;
    }
471702
@Indexable(type = IndexableType.REINDEX)
	@Override
	public CommerceAddress addCommerceAddress(CommerceAddress commerceAddress) {
		commerceAddress.setNew(true);

		return commerceAddressPersistence.update(commerceAddress);
	}
519369
public function createdToAdmin($order)
    {
        $store = $this->store->get($order['store_id']);
        $store_name = $this->store->getTranslation('title', $this->translation->getLangcode(), $store);
        $options = array('from' => reset($store['data']['email']));

        $default = (array) $this->store->getDefault(true);
        $url = $this->store->getUrl($default);

        $vars = array(
            '@store' => $store_name,
            '@order_id' => $order['order_id'],
            '@order' => "$url/admin/sale/order/{$order['order_id']}",
            '@status' => $this->order->getStatusName($order['status']),
            '@total' => $this->price->format($order['total'], $order['currency']),
        );

        $subject = $this->translation->text('New order #@order_id on @store', $vars);
        $message = $this->translation->text("Order status: @status\r\nTotal: @total\r\nView: @order", $vars);

        return array($options['from'], $subject, $message, $options);
    }
744288
public function getAddress($address, $limit=50, $offset=0, $filter=FilterType::RemoveUnspendable) {
        $params = array(
            'format'=>'json',
            'limit'=>intval($limit),
            'offset'=>intval($offset),
            'filter'=>intval($filter)
        );
        return new Address($this->blockchain->get('address/' . $address, $params));
    }
882711
public function create(array $params)
    {
        if (!array_key_exists('amount', $params) ||
            !array_key_exists('currency', $params) ||
            !array_key_exists('description', $params) ||
            !array_key_exists('order_id', $params) ||
            !array_key_exists('payment_options', $params) ||
            !array_key_exists('type', $params)
        ) {
            throw new \InvalidArgumentException('Invalid data provided.');
        }

        return $this->post('/orders', [], $params);
    }