From 7048a47f1681f1a51e68efa77c33d90ffeb6fdcf Mon Sep 17 00:00:00 2001 From: Kouril42 Date: Tue, 14 Feb 2023 02:11:56 +0100 Subject: [PATCH] typo + remove namePlace of Edition as it is useless with the connection to Entity\Place --- src/Controller/MapApiController.php | 6 +++--- src/Entity/Edition.php | 20 +------------------- 2 files changed, 4 insertions(+), 22 deletions(-) diff --git a/src/Controller/MapApiController.php b/src/Controller/MapApiController.php index 67fe022..85177bc 100644 --- a/src/Controller/MapApiController.php +++ b/src/Controller/MapApiController.php @@ -56,7 +56,7 @@ class MapApiController extends AbstractController foreach ($places as $place){ $jsonPlaces[] = array( 'id' => $place->getId(), - 'name' => $place->getJoinedNames(), + 'names' => $place->getJoinedNames(), 'type' => $place->getType(), 'surface' => $place->getTwoDRepresentation($representation, $floor->getAltitude()) ); @@ -88,7 +88,7 @@ class MapApiController extends AbstractController #[Route('/map/api/show_place_info/{id}')] - public function index(PlaceRepository $rep, int $id): JsonResponse + public function show_place_info(PlaceRepository $rep, int $id): JsonResponse { $places = $rep->findPlaceById($id); if (sizeof($places)!=1) { @@ -96,7 +96,7 @@ class MapApiController extends AbstractController } else { return $this->json([ - 'idRoom' => $places[0]->getId(), + 'idPlace' => $places[0]->getId(), 'names' => $places[0]->getJoinedNames(), 'users' => $places[0]->getJoinedRoomUsersNames() ]); diff --git a/src/Entity/Edition.php b/src/Entity/Edition.php index 4e5e440..bae0f74 100644 --- a/src/Entity/Edition.php +++ b/src/Entity/Edition.php @@ -23,9 +23,6 @@ class Edition #[ORM\ManyToOne(targetEntity: Place::class, inversedBy: "editions")] private $editedPlace; - #[ORM\Column(type: "string")] - private $namePlace; - #[ORM\Column(type: "string")] private $val; @@ -51,14 +48,6 @@ class Edition return $this; } - public function getNamePlace(): ?string - { return $this->namePlace; } - public function setNamePlace(string $name): self - { - $this->NamePlace = $name; - return $this; - } - public function getValue(): ?string { return $this->val; } public function setValue(string $val): self @@ -72,15 +61,8 @@ class Edition { $places = $rep->findPlaceById($id); if (sizeof($places)!=1) { return null; } - $place=$places[0]; - // $names = $place->getJoinedNames(); - // $name = ''; - // foreach ($names as $n) { - // $name = $name . $n . ", " ; - // } $this->mode = $mode; - $this->editedPlace = $place; - // $this->namePlace = $name; + $this->editedPlace = $places[0]; $this->val = $val; return $this; }