X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/cb70a2fde33e9c2455ea1cfb37ee430b00058b82..fc038261b9fe7f7d89a4000496185e72ac100a2a:/lib-php/Result.php diff --git a/lib-php/Result.php b/lib-php/Result.php index be103074..774b7ca6 100644 --- a/lib-php/Result.php +++ b/lib-php/Result.php @@ -55,6 +55,27 @@ class Result } ))); } + + public static function joinIdsByTableMinRank($aResults, $iTable, $iMinAddressRank) + { + return join(',', array_keys(array_filter( + $aResults, + function ($aValue) use ($iTable, $iMinAddressRank) { + return $aValue->iTable == $iTable && $aValue->iAddressRank >= $iMinAddressRank; + } + ))); + } + + public static function joinIdsByTableMaxRank($aResults, $iTable, $iMaxAddressRank) + { + return join(',', array_keys(array_filter( + $aResults, + function ($aValue) use ($iTable, $iMaxAddressRank) { + return $aValue->iTable == $iTable && $aValue->iAddressRank <= $iMaxAddressRank; + } + ))); + } + public static function sqlHouseNumberTable($aResults, $iTable) { $sHousenumbers = '';