class.userMapper.php
Gesponsorde koppelingen
PHP script bestanden
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<?php
/**
*
* @date 15 Aug 2012,
* @package Login System
*
*/
Class UserMapper extends DataMapper {
/**
* @param object $user,
* @param string $fields,
* @return mixed
*/
public function getByLoginCredentials(User $user, $fields = '*') {
$this->pdo->query("SELECT ".$fields." FROM users WHERE username = :username AND password = :password LIMIT 1", array(':username' => $user->getUsername(), ':password' => $user->getHashedPassword()));
return $this->pdo->fetch();
}
}
?>
/**
*
* @date 15 Aug 2012,
* @package Login System
*
*/
Class UserMapper extends DataMapper {
/**
* @param object $user,
* @param string $fields,
* @return mixed
*/
public function getByLoginCredentials(User $user, $fields = '*') {
$this->pdo->query("SELECT ".$fields." FROM users WHERE username = :username AND password = :password LIMIT 1", array(':username' => $user->getUsername(), ':password' => $user->getHashedPassword()));
return $this->pdo->fetch();
}
}
?>