1 | <?php |
||
13 | class ClientRegistry |
||
14 | { |
||
15 | /** @var Client[] */ |
||
16 | private $clients; |
||
17 | /** @var ClientConfiguration[] */ |
||
18 | private $configurations; |
||
19 | |||
20 | /** |
||
21 | * ClientRegistry constructor. |
||
22 | */ |
||
23 | 2 | public function __construct() |
|
28 | |||
29 | /** |
||
30 | * @param string $name |
||
31 | * @param array $conf |
||
32 | */ |
||
33 | 2 | public function addClientConfiguration(string $name, array $conf) |
|
37 | |||
38 | /** |
||
39 | * @param string $name |
||
40 | * @param string $databaseName |
||
41 | * |
||
42 | * @return Client |
||
43 | */ |
||
44 | 2 | public function getClientForDatabase(string $name, string $databaseName): Client |
|
48 | |||
49 | /** |
||
50 | * @param string $name |
||
51 | * @param string $databaseName |
||
52 | * |
||
53 | * @return Client |
||
54 | */ |
||
55 | 2 | public function getClient(string $name, string $databaseName = null): Client |
|
68 | |||
69 | /** |
||
70 | * @param array $conf |
||
71 | * |
||
72 | * @return ClientConfiguration |
||
73 | */ |
||
74 | 2 | private function buildClientConfiguration(array $conf): ClientConfiguration |
|
88 | } |
||
89 |