• Модуль: sale
  • Путь к файлу: ~/bitrix/modules/sale/lib/location/import/compiler/compiler.php
  • Класс: BitrixSaleLocationImportCompilerCompiler
  • Вызов: Compiler::getParentOfType
private function getParentOfType($code, $types)
{
	if(empty($types))
		return '';

	$nextCode = $code;
	$i = -1;
	while($nextCode)
	{
		$i++;

		if($i > 50)
			throw new MainSystemException('Recursion gone too deep when trying to find parent of type');

		if(isset($types[$this->code2type[$nextCode]]))
			return $nextCode;

		$nextCode = $this->relations[$nextCode];
	}

	return '';
}