• Модуль: location
  • Путь к файлу: ~/bitrix/modules/location/lib/source/google/converters/ancestordataconverter.php
  • Класс: BitrixLocationSourceGoogleConvertersAncestorDataConverter
  • Вызов: AncestorDataConverter::convertTypes
protected function convertTypes(array $types, int $descendantType)
{
	$result = [];

	foreach($types as $gType)
	{
		$type = PlaceTypeConverter::convert($gType);

		if($type === Type::UNKNOWN)
		{
			continue;
		}

		//Only location type
		if(!Type::isValueExist($type))
		{
			continue;
		}

		//Type::COUNTRY == 100 Type::LOCALITY == 300
		if($descendantType !== Type::UNKNOWN && $descendantType <= $type)
		{
			continue;
		}

		$result[] =  $type;
	}

	return $result;
}