From 32c5d7feda4cac76987edfce56d9e816b02f68a1 Mon Sep 17 00:00:00 2001 From: JonatanRek Date: Wed, 9 Oct 2019 10:56:46 +0200 Subject: [PATCH] Get All types of senzor for master devices function addet to subdevice manager --- app/class/SubDeviceManager.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/app/class/SubDeviceManager.php b/app/class/SubDeviceManager.php index 966db44..e2dd208 100644 --- a/app/class/SubDeviceManager.php +++ b/app/class/SubDeviceManager.php @@ -36,6 +36,16 @@ class SubDeviceManager return Db::loadOne("SELECT * FROM subdevices WHERE subdevice_id = ?;", array($subDeviceId)); } + public function getSubDevicesTypeForMater($deviceId) + { + $parsedTypes = []; + $types = Db::loadAll("SELECT type FROM subdevices WHERE device_id = ?;", array($deviceId)); + foreach ($types as $orderNum => $type) { + $parsedTypes[$orderNum] = $type['type']; + } + return $parsedTypes; + } + //check if dubdevice exist public function create($deviceId, $type, $unit)