From 2c4d809d49df6db7e9ad483d6dfa189b3b1a7747 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=91cze=20Bence?= Date: Mon, 15 Mar 2021 12:25:49 +0100 Subject: [PATCH] MAPG-203 remove placesWithoutPano logic from PlaceRepository --- src/Repository/PlaceRepository.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/Repository/PlaceRepository.php b/src/Repository/PlaceRepository.php index 0a2a197..e12cb0b 100644 --- a/src/Repository/PlaceRepository.php +++ b/src/Repository/PlaceRepository.php @@ -29,17 +29,14 @@ class PlaceRepository } //TODO: use Map instead of id - public function getRandomForMapWithValidPano(int $mapId, array $exclude = [], array &$placesWithoutPano): Place + public function getRandomForMapWithValidPano(int $mapId, array $exclude = []): Place { - $placesWithoutPano = []; - do { $place = $this->selectRandomFromDbForMap($mapId, $exclude); $panoId = $place->getFreshPanoId(); - if ($panoId === null) { - $placesWithoutPano[] = $exclude[] = $place->getId(); + $exclude[] = $place->getId(); } } while ($panoId === null);