typo + remove namePlace of Edition as it is useless with the connection to Entity\Place

This commit is contained in:
Kouril42 2023-02-14 02:11:56 +01:00
parent 5546eeb25e
commit 7048a47f16
2 changed files with 4 additions and 22 deletions

View File

@ -56,7 +56,7 @@ class MapApiController extends AbstractController
foreach ($places as $place){ foreach ($places as $place){
$jsonPlaces[] = array( $jsonPlaces[] = array(
'id' => $place->getId(), 'id' => $place->getId(),
'name' => $place->getJoinedNames(), 'names' => $place->getJoinedNames(),
'type' => $place->getType(), 'type' => $place->getType(),
'surface' => $place->getTwoDRepresentation($representation, $floor->getAltitude()) 'surface' => $place->getTwoDRepresentation($representation, $floor->getAltitude())
); );
@ -88,7 +88,7 @@ class MapApiController extends AbstractController
#[Route('/map/api/show_place_info/{id}')] #[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); $places = $rep->findPlaceById($id);
if (sizeof($places)!=1) { if (sizeof($places)!=1) {
@ -96,7 +96,7 @@ class MapApiController extends AbstractController
} }
else { else {
return $this->json([ return $this->json([
'idRoom' => $places[0]->getId(), 'idPlace' => $places[0]->getId(),
'names' => $places[0]->getJoinedNames(), 'names' => $places[0]->getJoinedNames(),
'users' => $places[0]->getJoinedRoomUsersNames() 'users' => $places[0]->getJoinedRoomUsersNames()
]); ]);

View File

@ -23,9 +23,6 @@ class Edition
#[ORM\ManyToOne(targetEntity: Place::class, inversedBy: "editions")] #[ORM\ManyToOne(targetEntity: Place::class, inversedBy: "editions")]
private $editedPlace; private $editedPlace;
#[ORM\Column(type: "string")]
private $namePlace;
#[ORM\Column(type: "string")] #[ORM\Column(type: "string")]
private $val; private $val;
@ -51,14 +48,6 @@ class Edition
return $this; return $this;
} }
public function getNamePlace(): ?string
{ return $this->namePlace; }
public function setNamePlace(string $name): self
{
$this->NamePlace = $name;
return $this;
}
public function getValue(): ?string public function getValue(): ?string
{ return $this->val; } { return $this->val; }
public function setValue(string $val): self public function setValue(string $val): self
@ -72,15 +61,8 @@ class Edition
{ {
$places = $rep->findPlaceById($id); $places = $rep->findPlaceById($id);
if (sizeof($places)!=1) { return null; } if (sizeof($places)!=1) { return null; }
$place=$places[0];
// $names = $place->getJoinedNames();
// $name = '';
// foreach ($names as $n) {
// $name = $name . $n . ", " ;
// }
$this->mode = $mode; $this->mode = $mode;
$this->editedPlace = $place; $this->editedPlace = $places[0];
// $this->namePlace = $name;
$this->val = $val; $this->val = $val;
return $this; return $this;
} }