コード例 #1
0
ファイル: Sales.php プロジェクト: spryker/Sales
 /**
  * @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);
     }
 }
コード例 #2
0
ファイル: OrderHydrator.php プロジェクト: spryker/Sales
 /**
  * @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);
 }