Пример #1
0
 /**
  * @param \Generated\Shared\Transfer\OrderTransfer $orderTransfer
  *
  * @throws \Spryker\Zed\Sales\Business\Exception\InvalidSalesOrderException
  *
  * @return \Orm\Zed\Sales\Persistence\SpySalesOrder
  */
 protected function getOrderEntity(OrderTransfer $orderTransfer)
 {
     $orderTransfer->requireIdSalesOrder()->requireFkCustomer();
     $orderEntity = $this->queryContainer->querySalesOrderDetails($orderTransfer->getIdSalesOrder())->filterByFkCustomer($orderTransfer->getFkCustomer())->findOne();
     if ($orderEntity === null) {
         throw new InvalidSalesOrderException(sprintf('Order could not be found for ID %s and customer ID %s', $orderTransfer->getIdSalesOrder(), $orderTransfer->getFkCustomer()));
     }
     return $orderEntity;
 }