diff options
Diffstat (limited to 'includes/model/UserDriverLicenses_model.php')
-rw-r--r-- | includes/model/UserDriverLicenses_model.php | 32 |
1 files changed, 4 insertions, 28 deletions
diff --git a/includes/model/UserDriverLicenses_model.php b/includes/model/UserDriverLicenses_model.php index 525d2016..798aa6ab 100644 --- a/includes/model/UserDriverLicenses_model.php +++ b/includes/model/UserDriverLicenses_model.php @@ -41,25 +41,14 @@ function UserDriverLicense_valid($user_driver_license) * Get a users driver license information * * @param int $user_id The users id - * @return array|false|null + * @return array|null */ function UserDriverLicense($user_id) { - $user_driver_license = DB::select(' + return DB::selectOne(' SELECT * FROM `UserDriverLicenses` WHERE `user_id`=?', [$user_id]); - - if (DB::getStm()->errorCode() != '00000') { - engelsystem_error('Unable to load user driver license.'); - return false; - } - - if (empty($user_driver_license)) { - return null; - } - - return array_shift($user_driver_license); } /** @@ -94,9 +83,6 @@ function UserDriverLicenses_create($user_driver_license, $user) (bool)$user_driver_license['has_license_forklift'], ] ); - if (DB::getStm()->errorCode() != '00000') { - engelsystem_error('Unable to create user driver license'); - } return $user_driver_license; } @@ -105,11 +91,10 @@ function UserDriverLicenses_create($user_driver_license, $user) * Update a user's driver license entry * * @param array $user_driver_license The UserDriverLicense to update - * @return bool */ function UserDriverLicenses_update($user_driver_license) { - $result = DB::update(' + DB::update(' UPDATE `UserDriverLicenses` SET `has_car`=?, @@ -130,23 +115,14 @@ function UserDriverLicenses_update($user_driver_license) $user_driver_license['user_id'], ] ); - if (DB::getStm()->errorCode() != '00000') { - engelsystem_error('Unable to update user driver license information'); - } - return $result; } /** * Delete a user's driver license entry * * @param int $user_id - * @return bool */ function UserDriverLicenses_delete($user_id) { - $result = DB::delete('DELETE FROM `UserDriverLicenses` WHERE `user_id`=?', [$user_id]); - if (DB::getStm()->errorCode() != '00000') { - engelsystem_error('Unable to remove user driver license information'); - } - return $result; + DB::delete('DELETE FROM `UserDriverLicenses` WHERE `user_id`=?', [$user_id]); } |