Created
February 23, 2019 11:27
-
-
Save tristanlins/0720511162bbfc6c4a9e4efa25ab8614 to your computer and use it in GitHub Desktop.
Programmierstil / Der Anfänger & Der Profi
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class UserDao { | |
| public function findByLoginFromRequest(Request $request) | |
| { | |
| $sql = 'SELECT user FROM users WHERE login=:login'; | |
| $login = $request->request->get('login'); | |
| $statement = $this->database->prepare($sql); | |
| $statement->bindValue(':login', $login); | |
| if ($statement->execute()) { | |
| return $statement->fetch(\PDO::FETCH_ASSOC); | |
| } | |
| return false; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment