code: protected function getOperator(SaleInterface $sale)
      {
          if ($sale instanceof CartInterface) {
              return $this->cartOperator;
          } elseif ($sale instanceof QuoteInterface) {
              return $this->quoteOperator;
          } elseif ($sale instanceof OrderInterface) {
              return $this->orderOperator;
          }
  
          throw new InvalidArgumentException("Unexpected sale type.");
      }
docs: Returns the proper operator for the given sale.
  
  @param SaleInterface $sale
  
  @return ResourceOperatorInterface