diff options
author | msquare <msquare@notrademark.de> | 2016-11-17 14:40:21 +0100 |
---|---|---|
committer | msquare <msquare@notrademark.de> | 2016-11-17 14:40:21 +0100 |
commit | 7b8d1918087b1d16519037afe61fd6ff09c68f94 (patch) | |
tree | ab450f444fc6fcc8bd39583d834e3cc005a2a92d /includes/model/UserDriverLicenses_model.php | |
parent | 9c4636f5c4dd5d3b7ff12effb553172f8235cfe6 (diff) |
reduce complexity of user driver license
Diffstat (limited to 'includes/model/UserDriverLicenses_model.php')
-rw-r--r-- | includes/model/UserDriverLicenses_model.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/includes/model/UserDriverLicenses_model.php b/includes/model/UserDriverLicenses_model.php index 6a3f14ab..6caa3589 100644 --- a/includes/model/UserDriverLicenses_model.php +++ b/includes/model/UserDriverLicenses_model.php @@ -4,9 +4,9 @@ * Returns a new empty UserDriverLicense * FIXME entity object needed */ -function UserDriverLicense_new($user) { +function UserDriverLicense_new() { return [ - 'user_id' => $user['UID'], + 'user_id' => null, 'has_car' => false, 'has_license_car' => false, 'has_license_3_5t_transporter' => false, @@ -51,7 +51,8 @@ function UserDriverLicense($user_id) { * @param UserDriverLicense $user_driver_license * The UserDriverLicense to create */ -function UserDriverLicenses_create($user_driver_license) { +function UserDriverLicenses_create($user_driver_license, $user) { + $user_driver_license['user_id'] = $user['UID']; $result = sql_query(" INSERT INTO `UserDriverLicenses` SET `user_id`=" . sql_escape($user_driver_license['user_id']) . ", @@ -64,7 +65,7 @@ function UserDriverLicenses_create($user_driver_license) { if ($result === false) { engelsystem_error('Unable to create user driver license'); } - return $result; + return $user_driver_license; } /** |