diff --git a/api/config/bundles.php b/api/config/bundles.php index 4559874..7fb3a34 100644 --- a/api/config/bundles.php +++ b/api/config/bundles.php @@ -12,5 +12,4 @@ Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true], Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true], Doctrine\Bundle\MongoDBBundle\DoctrineMongoDBBundle::class => ['all' => true], - ]; diff --git a/api/src/Controller/RestaurantController.php b/api/src/Controller/RestaurantController.php index 60cba1e..457afea 100644 --- a/api/src/Controller/RestaurantController.php +++ b/api/src/Controller/RestaurantController.php @@ -31,7 +31,7 @@ public function create(Request $request): JsonResponse $restaurant->setAddress($data['address']); $restaurant->setBorough($data['borough']); $restaurant->setcuisine($data['cuisine']); - + $this->restaurantRepository->save($restaurant); return new JsonResponse(['status' => 'Restaurant created!'], JsonResponse::HTTP_CREATED); diff --git a/api/src/Document/Restaurant.php b/api/src/Document/Restaurant.php index cb63026..f169ae1 100644 --- a/api/src/Document/Restaurant.php +++ b/api/src/Document/Restaurant.php @@ -25,52 +25,58 @@ class Restaurant #[Field] public string $cuisine; - + public function __construct() - {} + { + } -public function getId(): string -{ - return $this->id; -} -public function getName(): string -{ - return $this->name; -} -public function getAddress(): string -{ - return $this->address; + public function getId(): string + { + return $this->id; + } -} -public function getborough(): string -{ - return $this->borough; -} -public function getcuisine(): string -{ - return $this->cuisine; + public function getName(): string + { + return $this->name; + } -} -public function setId($id): void { - $this->id = $id; -} -public function setName(string $name): void + public function getAddress(): string + { + return $this->address; + } + + public function getBorough(): string + { + return $this->borough; + } + + public function getCuisine(): string + { + return $this->cuisine; + } + + public function setId($id): void + { + $this->id = $id; + } + + public function setName(string $name): void { $this->name = $name; } + public function setAddress(string $address): void { $this->address = $address; } - public function setborough(string $borough): void + public function setBorough(string $borough): void { $this->borough = $borough; } - public function setcuisine(string $cuisine): void + + public function setCuisine(string $cuisine): void { $this->cuisine = $cuisine; } - } -