diff --git a/src/NodaIDGetter.php b/src/NodaIDGetter.php index 0e92b2e..6101702 100644 --- a/src/NodaIDGetter.php +++ b/src/NodaIDGetter.php @@ -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. *