1 | <?php |
||
20 | class AuthenticationProvider implements UserProviderInterface |
||
21 | { |
||
22 | /** |
||
23 | * @var ModelInterface |
||
24 | */ |
||
25 | private $documentModel; |
||
26 | |||
27 | /** |
||
28 | * @var String |
||
29 | */ |
||
30 | private $queryField; |
||
31 | |||
32 | /** |
||
33 | * @param ModelInterface $model The documentModel |
||
34 | * @param string $queryField Field to search by |
||
35 | */ |
||
36 | 2 | public function __construct(ModelInterface $model, $queryField) |
|
41 | |||
42 | /** |
||
43 | * Loads the user for the given username. |
||
44 | * |
||
45 | * This method must throw UsernameNotFoundException if the user is not |
||
46 | * found. |
||
47 | * |
||
48 | * @param string $username the consultants username |
||
49 | * |
||
50 | * @return \Symfony\Component\Security\Core\User\UserInterface |
||
51 | * |
||
52 | * @see \Symfony\Component\Security\Core\Exception\UsernameNotFoundException |
||
53 | * |
||
54 | * @throws \Symfony\Component\Security\Core\Exception\UsernameNotFoundException if the user is not found |
||
55 | */ |
||
56 | public function loadUserByUsername($username) |
||
70 | |||
71 | /** |
||
72 | * Refreshes the user for the account interface. |
||
73 | * |
||
74 | * It is up to the implementation to decide if the user data should be |
||
75 | * totally reloaded (e.g. from the database), or if the UserInterface |
||
76 | * object can just be merged into some internal array of users / identity |
||
77 | * map. |
||
78 | * |
||
79 | * @param \Symfony\Component\Security\Core\User\UserInterface $user user to refresh |
||
80 | * |
||
81 | * @return \Symfony\Component\Security\Core\User\UserInterface |
||
82 | * |
||
83 | * @throws \Symfony\Component\Security\Core\Exception\UnsupportedUserException if the account is not supported |
||
84 | */ |
||
85 | public function refreshUser(UserInterface $user) |
||
93 | |||
94 | /** |
||
95 | * Whether this provider supports the given user class. |
||
96 | * |
||
97 | * @param string $class class to check for support |
||
98 | * |
||
99 | * @return bool |
||
100 | */ |
||
101 | public function supportsClass($class) |
||
105 | } |
||
106 |