summaryrefslogtreecommitdiff
path: root/includes/model/UserDriverLicenses_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/UserDriverLicenses_model.php
parent69a1ee2bfefb43a802dea8cf0f833cbe0a00369c (diff)
dried code by introducing selectOne for select queries with only one result line expected
Diffstat (limited to 'includes/model/UserDriverLicenses_model.php')
-rw-r--r--includes/model/UserDriverLicenses_model.php8
1 files changed, 1 insertions, 7 deletions
diff --git a/includes/model/UserDriverLicenses_model.php b/includes/model/UserDriverLicenses_model.php
index 515a2701..798aa6ab 100644
--- a/includes/model/UserDriverLicenses_model.php
+++ b/includes/model/UserDriverLicenses_model.php
@@ -45,16 +45,10 @@ function UserDriverLicense_valid($user_driver_license)
*/
function UserDriverLicense($user_id)
{
- $user_driver_license = DB::select('
+ return DB::selectOne('
SELECT *
FROM `UserDriverLicenses`
WHERE `user_id`=?', [$user_id]);
-
- if (empty($user_driver_license)) {
- return null;
- }
-
- return array_shift($user_driver_license);
}
/**