• Модуль: location
  • Путь к файлу: ~/bitrix/modules/location/lib/repository/location/database.php
  • Класс: BitrixLocationRepositoryLocationDatabase
  • Вызов: Database::saveName
private function saveName(Location $location, bool $isLocationNew)
{
	$fields = LocationConverterDbFieldConverter::convertNameToDbFields($location);
	$itemExist = false;

	if(!$isLocationNew)
	{
		$itemExist = $this->locationNameTable::getById([
			'LOCATION_ID' => $fields['LOCATION_ID'],
			'LANGUAGE_ID' => $fields['LANGUAGE_ID']]
		)->fetch();
	}

	if($itemExist)
	{
		$result = $this->locationNameTable::update([
		   'LOCATION_ID' => $fields['LOCATION_ID'],
		   'LANGUAGE_ID' => $fields['LANGUAGE_ID']
	   ], $fields);
	}
	else
	{
		$result = $this->locationNameTable::add($fields);
	}

	return $result;
}