1 | <?php |
||
11 | class ElegantUserProvider implements UserProvider |
||
12 | { |
||
13 | /** |
||
14 | * The Elegant user model. |
||
15 | * |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $model; |
||
19 | |||
20 | /** |
||
21 | * The active connection. |
||
22 | * |
||
23 | * @var \GuzzleHttp\Client |
||
24 | */ |
||
25 | protected $client; |
||
26 | |||
27 | /** |
||
28 | * Create a new elegant user provider instance. |
||
29 | * |
||
30 | * @param \GuzzleHttp\Client $client |
||
31 | * @param string $model |
||
32 | */ |
||
33 | public function __construct(Client $client, $model) |
||
34 | { |
||
35 | $this->client = $client; |
||
36 | $this->model = $model; |
||
37 | } |
||
38 | |||
39 | /** |
||
40 | * Retrieve a user by their unique token. |
||
41 | * |
||
42 | * @return \Magister\Services\Database\Elegant\Model|null |
||
43 | */ |
||
44 | public function retrieveByToken() |
||
48 | |||
49 | /** |
||
50 | * Remove the token for the given user in storage. |
||
51 | * |
||
52 | * @return void |
||
53 | */ |
||
54 | public function removeToken() |
||
58 | |||
59 | /** |
||
60 | * Retrieve a user by the given credentials. |
||
61 | * |
||
62 | * @param array $credentials |
||
63 | * |
||
64 | * @return \Magister\Services\Database\Elegant\Model|null |
||
65 | */ |
||
66 | public function retrieveByCredentials(array $credentials) |
||
75 | |||
76 | /** |
||
77 | * Create a new instance of the model. |
||
78 | * |
||
79 | * @return \Magister\Services\Database\Elegant\Model |
||
80 | */ |
||
81 | public function createModel() |
||
87 | } |
||
88 |