Get billing address2.
public getBillingAddress2 ( ) : string | ||
리턴 | string | $billingAddress2 |
/** * Transforms an order into an invoice * * @param OrderInterface $order * @param InvoiceInterface $invoice */ public function transformFromOrder(OrderInterface $order, InvoiceInterface $invoice) { $event = new OrderTransformEvent($order); $this->eventDispatcher->dispatch(TransformerEvents::PRE_ORDER_TO_INVOICE_TRANSFORM, $event); $invoice->setName($order->getBillingName()); $invoice->setAddress1($order->getBillingAddress1()); $invoice->setAddress2($order->getBillingAddress2()); $invoice->setAddress3($order->getBillingAddress3()); $invoice->setCity($order->getBillingCity()); $invoice->setCountry($order->getBillingCountryCode()); $invoice->setPostcode($order->getBillingPostcode()); $invoice->setEmail($order->getBillingEmail()); $invoice->setFax($order->getBillingFax()); $invoice->setMobile($order->getBillingMobile()); $invoice->setPhone($order->getBillingPhone()); $invoice->setReference($order->getReference()); $invoice->setCurrency($order->getCurrency()); $invoice->setCustomer($order->getCustomer()); $invoice->setTotalExcl($order->getTotalExcl()); $invoice->setTotalInc($order->getTotalInc()); $invoice->setPaymentMethod($order->getPaymentMethod()); $invoice->setLocale($order->getLocale()); foreach ($order->getOrderElements() as $orderElement) { $invoiceElement = $this->createInvoiceElementFromOrderElement($orderElement); $invoiceElement->setInvoice($invoice); $invoice->addInvoiceElement($invoiceElement); } if ($order->getDeliveryCost() > 0) { $this->addDelivery($invoice, $order); } $invoice->setStatus(InvoiceInterface::STATUS_OPEN); $event = new InvoiceTransformEvent($invoice); $this->eventDispatcher->dispatch(TransformerEvents::POST_ORDER_TO_INVOICE_TRANSFORM, $event); }
/** * Gets formatted address lines from $order * * @param OrderInterface $order * @return string */ protected function getAddress(OrderInterface $order) { $ret = $order->getBillingAddress1(); if (null !== $order->getBillingAddress2()) { $ret .= " " . $order->getBillingAddress2(); } if (null !== $order->getBillingAddress3()) { $ret .= " " . $order->getBillingAddress3(); } return $ret; }