/** * @param $login * @param $password * @return bool */ public function checkLoginAndPassword($login, $password) { $model = new UserModel(); $model->setLogin($login); $model->setPassword($password); return $this->dao->checkLogin($model); }
/** * @param $model, User Model * @return UserModel, JsonSerialise */ public function read($model) { $id = $model->getId(); $sql = "SELECT *\n FROM `tbluser`\n WHERE `id` = '{$id}'"; $response = $this->dao->connection->query($sql); $response = mysqli_fetch_row($response); $readId = $response[0]; $readFirstName = $response[1]; $readLastName = $response[2]; $readLogin = $response[3]; $readPassword = $response[4]; $readUser = new UserModel(); $readUser->setId($readId); $readUser->setFirstName($readFirstName); $readUser->setLastName($readLastName); $readUser->setLogin($readLogin); $readUser->setPassword($readPassword); return $readUser; }