• Модуль: location
  • Путь к файлу: ~/bitrix/modules/location/lib/repository/location/database.php
  • Класс: BitrixLocationRepositoryLocationDatabase
  • Вызов: Database::findParents
public function findParents(Location $location, string $languageId)
{
	if($location->getId() <= 0)
	{
		return null;
	}

	$ormCollection = $this->hierarchyTable::getList([
		'filter' => [
			'=DESCENDANT_ID' => $location->getId(),
			'=ANCESTOR.NAME.LANGUAGE_ID' => $languageId, //todo: if not found required language
		],
		'order' => ['LEVEL' => 'ASC'],
		'select' => [
			'*',
			'ANCESTOR',
			'ANCESTOR.NAME'
		]
	])->fetchCollection();

	$result = BitrixLocationEntityLocationConverterOrmConverter::createParentCollection($ormCollection, $languageId);
	$result->setDescendant($location);
	return $result;
}