Skip to content

Instantly share code, notes, and snippets.

@tristanlins
Created February 23, 2019 11:26
Show Gist options
  • Save tristanlins/2cdc6de5f895085aa35f6e4f2e950a81 to your computer and use it in GitHub Desktop.
Save tristanlins/2cdc6de5f895085aa35f6e4f2e950a81 to your computer and use it in GitHub Desktop.
Programmierstil / Der gesittete Programmierer
<?php
class UserDao {
public function findByLoginFromRequest(Request $req)
{
$login = $req->request->get('login');
$statement = $this->db->prepare('SELECT user FROM users WHERE login=?');
$statement->bindValue(1, $login);
return $statement->execute() ? $statement->fetch(\PDO::FETCH_ASSOC) : false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment