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

        if(!DocumentType::IsDefined($typeId))
        {
            throw new ArgumentOutOfRangeException('Is not defined', DocumentType::FIRST, DocumentType::LAST);
        }

        if(self::$instances === null || !isset(self::$instances[$typeId]))
        {
            if(self::$instances === null)
            {
                self::$instances = array();
            }

            if(!isset(self::$instances[$typeId]))
            {
			self::$instances[$typeId] = ConverterFactory::create($typeId);
            }
        }
        return self::$instances[$typeId];
    }