• Модуль: location
  • Путь к файлу: ~/bitrix/modules/location/lib/source/osm/converters/ruconverter.php
  • Класс: BitrixLocationSourceOsmConvertersRuConverter
  • Вызов: RuConverter::getAdminLevel2
protected function getAdminLevel2(): ?array
{
	$municipalDistrictAdminLevel = $this->isCityState()
		? static::CITY_FEDERAL_SUBJECT_MUNICIPAL_DISTRICT_ADMIN_LEVEL
		: static::FEDERAL_SUBJECT_MUNICIPAL_DISTRICT_ADMIN_LEVEL;

	foreach ($this->addressComponents as $addressComponent)
	{
		if ($this->isAdministrativeBoundary($addressComponent)
			&& $addressComponent['admin_level'] === $municipalDistrictAdminLevel
		)
		{
			return $addressComponent;
		}
	}

	return null;
}