Add getting places by noda links to NodaIDGetter

This commit is contained in:
Joshua Ramon Enslin 2020-10-01 12:53:27 +02:00 committed by Stefan Rohde-Enslin
parent 67cc76cff9
commit 3664bcf3f6

View File

@ -139,6 +139,38 @@ final class NodaIDGetter {
}
/**
* Returns place ID by entry in place noda table.
*
* @param MDMysqli $mysqli_noda Database connection.
* @param string $noda_source Language to check in.
* @param string $noda_nrinsource Name of the place to search for.
*
* @return integer
*/
public static function getPlaceIDByNodaLink(MDMysqli $mysqli_noda, string $noda_source, string $noda_nrinsource):int {
if (empty($name)) return 0;
$placeByNodaResult = $mysqli_noda->query_by_stmt("
SELECT `ort_id`
FROM `noda_orte`
WHERE `noda_source` = ?
AND `noda_nrinsource` = ?
LIMIT 2", "ss", $noda_source, $noda_nrinsource);
if ($placeByNodaData = $placeByNodaResult->fetch_row()) {
$output = $placeByNodaData[0];
}
else $output = 0;
$placeByNodaResult->close();
$placeByNodaResult = null;
return $output;
}
/**
* Returns tag ID by entry in tag name rewriting table.
*