Update base update time of places when editing a place
This commit is contained in:
@ -143,6 +143,36 @@ final class NodaIDGetter {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns place ID by base name.
|
||||
*
|
||||
* @param MDMysqli $mysqli_noda Database connection.
|
||||
* @param string $name Name of the place to search for.
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public static function getPlaceIDByBaseName(MDMysqli $mysqli_noda, string $name):int {
|
||||
|
||||
if (empty($name)) return 0;
|
||||
|
||||
$placeByBaseNameResult = $mysqli_noda->query_by_stmt("
|
||||
SELECT `ort_id`
|
||||
FROM `orte`
|
||||
WHERE `ort_name` = ?
|
||||
LIMIT 2", "s", $name);
|
||||
|
||||
if ($placeByBaseData = $placeByBaseNameResult->fetch_row()) {
|
||||
$output = $placeByBaseData[0];
|
||||
}
|
||||
else $output = 0;
|
||||
|
||||
$placeByBaseNameResult->close();
|
||||
$placeByBaseNameResult = null;
|
||||
|
||||
return $output;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns place ID by entry in place translations table.
|
||||
*
|
||||
|
Reference in New Issue
Block a user