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

	if(!DocumentType::IsDefined($documentTypeID))
	{
		throw new ArgumentOutOfRangeException('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 NotSupportedException("Document type: '".EntityType::ResolveName($documentTypeID)."' is not supported in current context");
	}
}