Beispiel #1
0
 /**
  * @param \Orm\Zed\Sales\Persistence\SpySalesOrder $salesOrderEntity
  *
  * @return void
  */
 protected function addAddresses(SpySalesOrder $salesOrderEntity)
 {
     $billingAddressEntity = $salesOrderEntity->getBillingAddress();
     if ($billingAddressEntity === null) {
         $billingAddressEntity = $this->createBillingAddress();
         $salesOrderEntity->setBillingAddress($billingAddressEntity);
     }
     $shippingAddressEntity = $salesOrderEntity->getShippingAddress();
     if ($shippingAddressEntity === null) {
         $salesOrderEntity->setShippingAddress($billingAddressEntity);
     }
 }
Beispiel #2
0
 /**
  * @param \Orm\Zed\Sales\Persistence\SpySalesOrder $orderEntity
  * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
  *
  * @return void
  */
 protected function hydrateShippingAddressToOrderTransfer(SpySalesOrder $orderEntity, OrderTransfer $orderTransfer)
 {
     $shippingAddressTransfer = new AddressTransfer();
     $shippingAddressTransfer->fromArray($orderEntity->getShippingAddress()->toArray(), true);
     $shippingAddressTransfer->setIso2Code($orderEntity->getShippingAddress()->getCountry()->getIso2Code());
     $orderTransfer->setShippingAddress($shippingAddressTransfer);
 }