- /**
- * Sets the billing address, if any, for the order.
- *
- * @param \Magento\Sales\Api\Data\OrderAddressInterface $address
- * @return $this
- */
- public function setBillingAddress(\Magento\Sales\Api\Data\OrderAddressInterface $address = null)
- {
- $old = $this->getBillingAddress();
- if (!empty($old) && !empty($address)) {
- $address->setId($old->getId());
- }
-
- if (!empty($address)) {
- $address->setEmail($this->getCustomerEmail());
- $this->addAddress($address->setAddressType('billing'));
- }
- return $this;
- }