code: private function transform(SaleInterface $sale)
      {
          $order = $this->newOrder();
  
          // Initialize transformation
          $this->saleTransformer->initialize($sale, $order);
  
          // Transform
          if (null === $event = $this->saleTransformer->transform()) {
              // Success
              return $order;
          }
  
          return null;
      }
docs: Transforms the given cart or quote to an order.
  
  @param SaleInterface $sale
  
  @return OrderInterface|null