/** * @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); } }
/** * @param \Orm\Zed\Sales\Persistence\SpySalesOrder $orderEntity * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer * * @return void */ protected function hydrateBillingAddressToOrderTransfer(SpySalesOrder $orderEntity, OrderTransfer $orderTransfer) { $billingAddressTransfer = new AddressTransfer(); $billingAddressTransfer->fromArray($orderEntity->getBillingAddress()->toArray(), true); $billingAddressTransfer->setIso2Code($orderEntity->getBillingAddress()->getCountry()->getIso2Code()); $orderTransfer->setBillingAddress($billingAddressTransfer); }