diff --git a/src/Controller/MapApiController.php b/src/Controller/MapApiController.php index f130314..c0bd8da 100644 --- a/src/Controller/MapApiController.php +++ b/src/Controller/MapApiController.php @@ -95,14 +95,9 @@ class MapApiController extends AbstractController if ($representation == 'Cylinder' || $representation == 'PolySurface'){ foreach ($places as $place){ $connectedFloors = array(); - $seen = new ArrayCollection(); - $seen[] = $floor->getId(); - foreach ($place->getConnectedPlaces() as $cp) { - foreach ($cp->getFloors() as $cf) { - if (!$seen->contains($cf->getId())){ - $connectedFloors[] = array('id' => $cf->getId(), 'name' => $cf->getName()); - $seen[] = $cf->getId(); - } + foreach ($place->getFloors() as $f) { + if ($f->getId() != $id) { + $connectedFloors[] = array('id' => $f->getId(), 'name' => $f->getName()); } } $jsonPlaces[] = array(