From de14863e2f7b7e99bdda4c5cd1232771b65d92f8 Mon Sep 17 00:00:00 2001 From: Kendrick Chan Date: Mon, 4 Jun 2018 04:16:40 +0800 Subject: [PATCH] Add flag_mobile fields in vehicle and vehicle manufacturer #134 --- src/Controller/RAPIController.php | 3 ++- src/Entity/Vehicle.php | 19 +++++++++++++++++++ src/Entity/VehicleManufacturer.php | 18 ++++++++++++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) diff --git a/src/Controller/RAPIController.php b/src/Controller/RAPIController.php index 4973d5b2..a0c18b8b 100644 --- a/src/Controller/RAPIController.php +++ b/src/Controller/RAPIController.php @@ -24,6 +24,7 @@ use App\Ramcar\TradeInType; use App\Ramcar\InvoiceStatus; use App\Service\InvoiceCreator; +use App\Service\MQTTClient; use App\Entity\RiderSession; use App\Entity\Customer; @@ -457,7 +458,7 @@ class RAPIController extends Controller $jo->setStatus(JOStatus::IN_TRANSIT); $em->flush(); - // TODO: send mqtt event + // TODO: send mqtt event (?) // TODO: add event diff --git a/src/Entity/Vehicle.php b/src/Entity/Vehicle.php index f751b473..e7a9a22a 100644 --- a/src/Entity/Vehicle.php +++ b/src/Entity/Vehicle.php @@ -59,10 +59,18 @@ class Vehicle */ protected $batteries; + // display in mobile app + /** + * @ORM\Column(type="boolean") + */ + protected $flag_mobile; + + public function __construct() { $this->customers = new ArrayCollection(); $this->batteries = new ArrayCollection(); + $this->flag_mobile = true; } public function getID() @@ -151,4 +159,15 @@ class Vehicle { return $this->batteries; } + + public function setDisplayMobile($bool = true) + { + $this->flag_mobile = $bool; + return $this; + } + + public function shouldDisplayMobile() + { + return $this->flag_mobile; + } } diff --git a/src/Entity/VehicleManufacturer.php b/src/Entity/VehicleManufacturer.php index 00026b05..86c1be4b 100644 --- a/src/Entity/VehicleManufacturer.php +++ b/src/Entity/VehicleManufacturer.php @@ -34,9 +34,16 @@ class VehicleManufacturer */ protected $vehicles; + // display in mobile app + /** + * @ORM\Column(type="boolean") + */ + protected $flag_mobile; + public function __construct() { $this->vehicles = new ArrayCollection(); + $this->flag_mobile = true; } public function getID() @@ -71,4 +78,15 @@ class VehicleManufacturer { return $this->vehicles; } + + public function setDisplayMobile($bool = true) + { + $this->flag_mobile = $bool; + return $this; + } + + public function shouldDisplayMobile() + { + return $this->flag_mobile; + } }