1 | <?php namespace Cerbero\Auth\Repositories; |
||
8 | class EloquentUserRepository implements UserRepositoryInterface { |
||
9 | |||
10 | /** |
||
11 | * @author Andrea Marco Sartori |
||
12 | * @var User $user User model. |
||
13 | */ |
||
14 | protected $user; |
||
15 | |||
16 | /** |
||
17 | * Set the dependencies. |
||
18 | * |
||
19 | * @author Andrea Marco Sartori |
||
20 | * @return void |
||
21 | */ |
||
22 | public function __construct() |
||
28 | |||
29 | /** |
||
30 | * Register a new user. |
||
31 | * |
||
32 | * @author Andrea Marco Sartori |
||
33 | * @param array $attributes |
||
34 | * @return User |
||
35 | */ |
||
36 | public function register(array $attributes) |
||
40 | |||
41 | /** |
||
42 | * Assign a token to reset the password of the user with the given email. |
||
43 | * |
||
44 | * @author Andrea Marco Sartori |
||
45 | * @param string $token |
||
46 | * @param string $email |
||
47 | * @return void |
||
48 | */ |
||
49 | public function assignResetToken($token, $email) |
||
57 | |||
58 | /** |
||
59 | * Retrieve the user with the given reset token. |
||
60 | * |
||
61 | * @author Andrea Marco Sartori |
||
62 | * @param string $token |
||
63 | * @return User|null |
||
64 | */ |
||
65 | public function findByResetToken($token) |
||
69 | |||
70 | /** |
||
71 | * Reset the password of the given user. |
||
72 | * |
||
73 | * @author Andrea Marco Sartori |
||
74 | * @param User $user |
||
75 | * @param string $password |
||
76 | * @return boolean |
||
77 | */ |
||
78 | public function resetPassword($user, $password) |
||
86 | |||
87 | } |
||
88 |