mirror of
https://gitlab.aliens-lyon.fr/encartes/backend.git
synced 2026-09-11 16:50:46 +02:00
add idSite and idBuilding to get_floor
This commit is contained in:
@@ -91,7 +91,7 @@ class MapApiController extends AbstractController
|
||||
elseif (sizeof($floors)>1) { throw new Exception('Internal Error: '.$id.' refers to more than one floorId ; the BDD is corrupted.'); }
|
||||
$floor = $floors[0];
|
||||
$places = $floor->getPlaces();
|
||||
$jsonPlaces = new ArrayCollection();
|
||||
$jsonPlaces = array();
|
||||
if ($representation == 'Cylinder' || $representation == 'PolySurface'){
|
||||
foreach ($places as $place){
|
||||
$jsonPlaces[] = array(
|
||||
@@ -105,7 +105,11 @@ class MapApiController extends AbstractController
|
||||
else {
|
||||
return $this->json(["Error on represantation attribute"]);
|
||||
}
|
||||
return $this->json($jsonPlaces->toArray());
|
||||
$building = $floor->getBuilding();
|
||||
return $this->json(['idSite' => $building->getId(),
|
||||
'idBuilding' => $building->getSite()->getId(),
|
||||
'places' => $jsonPlaces
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/api/map/get_all_floors/')]
|
||||
|
||||
Reference in New Issue
Block a user