summaryrefslogtreecommitdiff
path: root/includes/model/Room_model.php
diff options
context:
space:
mode:
authormsquare <msquare@notrademark.de>2017-07-28 20:11:09 +0200
committermsquare <msquare@notrademark.de>2017-07-28 20:11:09 +0200
commitf82e5456d22af7e39a22a9a64e74072cf01e0a31 (patch)
treec024194bd11621e1956a659a0ec91ee7c747b40c /includes/model/Room_model.php
parent69a1ee2bfefb43a802dea8cf0f833cbe0a00369c (diff)
dried code by introducing selectOne for select queries with only one result line expected
Diffstat (limited to 'includes/model/Room_model.php')
-rw-r--r--includes/model/Room_model.php8
1 files changed, 1 insertions, 7 deletions
diff --git a/includes/model/Room_model.php b/includes/model/Room_model.php
index 08e0f7bf..8425e5ad 100644
--- a/includes/model/Room_model.php
+++ b/includes/model/Room_model.php
@@ -58,17 +58,11 @@ function Room_create($name, $from_frab, $public, $number = null)
*/
function Room($room_id, $onlyVisible = true)
{
- $room_source = DB::select('
+ return DB::selectOne('
SELECT *
FROM `Room`
WHERE `RID` = ?
' . ($onlyVisible ? 'AND `show` = \'Y\'' : ''),
[$room_id]
);
-
- if (empty($room_source)) {
- return null;
- }
-
- return array_shift($room_source);
}