$type) { $parsedTypes[$orderNum] = $type['type']; } return $parsedTypes; } //check if dubdevice exist public function create($deviceId, $type, $unit) { $record = array( 'device_id' => $deviceId, 'type' => $type, 'unit' => $unit, ); try { Db::add('subdevices', $record); } catch (PDOException $error) { echo $error->getMessage(); die(); } } public function remove($subDeviceId) { RecordManager::cleanSubdeviceRecords($subDeviceId); return Db::loadAll("DELETE FROM subdevices WHERE subdevice_id = ?", array($subDeviceId)); } }