X-Git-Url: https://git.openstreetmap.org./nominatim.git/blobdiff_plain/db3ced17bbfff00411f506d8c84419c875959d5e..3e6be0b0be11cb2f398b2fccca91fa502b1a1f51:/lib-php/Result.php?ds=sidebyside diff --git a/lib-php/Result.php b/lib-php/Result.php index a67c2fe4..4b244d1d 100644 --- a/lib-php/Result.php +++ b/lib-php/Result.php @@ -1,4 +1,12 @@ 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 = ''; @@ -84,7 +114,7 @@ class Result foreach ($aResults as $oRes) { if ($oRes->iResultRank < $iMinRank) { - $aTail = array_merge($aTail, $aHead); + $aTail += $aHead; $aHead = array($oRes->iId => $oRes); $iMinRank = $oRes->iResultRank; } elseif ($oRes->iResultRank == $iMinRank) {