From c7af1c15928cf328bc4810ccab9c2bf72718dc05 Mon Sep 17 00:00:00 2001 From: Korina Cordero Date: Mon, 20 Apr 2020 03:37:40 +0000 Subject: [PATCH] Add rider_slots to hub. #381 --- src/Controller/HubController.php | 3 ++- src/Entity/Hub.php | 17 +++++++++++++++++ templates/hub/form.html.twig | 9 ++++++++- 3 files changed, 27 insertions(+), 2 deletions(-) diff --git a/src/Controller/HubController.php b/src/Controller/HubController.php index d6334c80..2c58c0ef 100644 --- a/src/Controller/HubController.php +++ b/src/Controller/HubController.php @@ -152,7 +152,8 @@ class HubController extends Controller ->setTimeClose($time_close) ->setCoordinates($point) ->setBranchCode($req->request->get('branch_code', '')) - ->setStatusOpen($req->request->get('status_open') ?? false); + ->setStatusOpen($req->request->get('status_open') ?? false) + ->setRiderSlots($req->request->get('rider_slots'), 0); } protected function setQueryFilters($datatable, QueryBuilder $query) diff --git a/src/Entity/Hub.php b/src/Entity/Hub.php index f92a424e..9edcb88a 100644 --- a/src/Entity/Hub.php +++ b/src/Entity/Hub.php @@ -56,6 +56,12 @@ class Hub */ protected $status_open; + // number of rider slots per day + /** + * @ORM\Column(type="integer") + */ + protected $rider_slots; + public function __construct() { $this->time_open = new DateTime(); @@ -150,4 +156,15 @@ class Hub return $this->status_open; } + public function setRiderSlots($rider_slots) + { + $this->rider_slots = $rider_slots; + return $this; + } + + public function getRiderSlots() + { + return $this->rider_slots; + } + } diff --git a/templates/hub/form.html.twig b/templates/hub/form.html.twig index aed63021..b47b546d 100644 --- a/templates/hub/form.html.twig +++ b/templates/hub/form.html.twig @@ -90,7 +90,14 @@
-
+
+ + + +
+