1 | <?php |
||
8 | class UserRepositoryCollection |
||
9 | { |
||
10 | /** |
||
11 | * @var array |
||
12 | */ |
||
13 | private $userRepositories = []; |
||
14 | |||
15 | /** |
||
16 | * UserRepositoryCollection constructor. |
||
17 | * |
||
18 | * @param array $userRepositories |
||
19 | */ |
||
20 | public function __construct(array $userRepositories) |
||
26 | |||
27 | /** |
||
28 | * Registers the UserRepository to the UserRepositoryCollection. |
||
29 | * |
||
30 | * @param UserRepository $userRepository |
||
31 | */ |
||
32 | public function addUserRepository(UserRepository $userRepository) |
||
36 | |||
37 | /** |
||
38 | * Get the userRepositories. |
||
39 | * |
||
40 | * @throws NoRepositoriesRegisteredException |
||
41 | * |
||
42 | * @return array |
||
43 | */ |
||
44 | public function all() |
||
52 | |||
53 | /** |
||
54 | * Find the UserRepository for a given User Class. |
||
55 | * |
||
56 | * @param $className |
||
57 | * |
||
58 | * @throws RepositoryNotRegisteredException |
||
59 | * |
||
60 | * @return UserRepository |
||
61 | */ |
||
62 | public function findRepositoryByClassName($className) |
||
72 | |||
73 | /** |
||
74 | * @param $token |
||
75 | * |
||
76 | * @return UserInterface|null |
||
77 | */ |
||
78 | public function findUserByToken($token) |
||
90 | |||
91 | /** |
||
92 | * @param $username |
||
93 | */ |
||
94 | public function findUserByUserName($username) |
||
106 | } |
||
107 |