• Модуль: location
  • Путь к файлу: ~/bitrix/modules/location/lib/source/osm/converters/baseconverter.php
  • Класс: BitrixLocationSourceOsmConvertersBaseConverter
  • Вызов: BaseConverter::getLocalityByTypes
protected function getLocalityByTypes(array $types): ?array
{
	$settlementTypePriorityList = $this->getSettlementTypes();

	foreach ($settlementTypePriorityList as $settlementType)
	{
		foreach ($this->addressComponents as $addressComponent)
		{
			if (!in_array($addressComponent['osm_type'], $types, true))
			{
				continue;
			}

			$componentPlaceType = $this->getAddressComponentPlaceType($addressComponent);
			if (!$componentPlaceType)
			{
				continue;
			}

			if ($componentPlaceType === $settlementType)
			{
				return $addressComponent;
			}
		}
	}

	return null;
}