• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/exchange/onec/documentimportfactory.php
  • Класс: BitrixSaleExchangeOneCDocumentImportFactory
  • Вызов: DocumentImportFactory::create
static function create($documentTypeID)
    {
        if(!is_int($documentTypeID))
        {
            $documentTypeID = (int)$documentTypeID;
        }

        if(!DocumentType::IsDefined($documentTypeID))
        {
            throw new MainArgumentOutOfRangeException('documentTypeID', DocumentType::FIRST, DocumentType::LAST);
        }

        if($documentTypeID === DocumentType::ORDER)
        {
            return new OrderDocument();
        }
        elseif($documentTypeID === DocumentType::SHIPMENT)
        {
            return new ShipmentDocument();
        }
        elseif($documentTypeID === DocumentType::PAYMENT_CASH)
        {
            return new PaymentCashDocument();
        }
        elseif($documentTypeID === DocumentType::PAYMENT_CASH_LESS)
        {
            return new PaymentCashLessDocument();
        }
        elseif($documentTypeID === DocumentType::PAYMENT_CARD_TRANSACTION)
        {
            return new PaymentCardDocument();
        }
        elseif($documentTypeID === DocumentType::PROFILE)
        {
            return new ProfileDocument();
        }
	elseif($documentTypeID === DocumentType::USER_PROFILE)
	{
		return new UserProfileDocument();
	}
        else
        {
            throw new MainNotSupportedException("Document type: '".ExchangeEntityType::ResolveName($documentTypeID)."' is not supported in current context");
        }
    }