1 | <?php |
||
20 | class MongoDbStorageDriverFactory implements StorageDriverFactory |
||
21 | { |
||
22 | /** @var EntityPool */ |
||
23 | private $entityPool; |
||
24 | /** @var MongoDbCodecSet */ |
||
25 | private $codecSet; |
||
26 | |||
27 | /** @var Client[] Key is the dns, value is the Client */ |
||
28 | private $dns2client = []; |
||
29 | |||
30 | /** |
||
31 | * MongoDbStorageDriverFactory constructor. |
||
32 | * |
||
33 | * @param EntityPool $entityPool |
||
34 | * @param MongoDbCodecSet $codecSet |
||
35 | */ |
||
36 | public function __construct(EntityPool $entityPool, MongoDbCodecSet $codecSet) |
||
41 | |||
42 | /** |
||
43 | * @return Client[] |
||
44 | */ |
||
45 | public function getDns2client() |
||
49 | |||
50 | /** |
||
51 | * @param array $config |
||
52 | * @param string $tableName |
||
53 | * @param \ReflectionClass $baseClass |
||
54 | * |
||
55 | * @return StorageDriver|MongoDbStorageDriver |
||
56 | */ |
||
57 | public function create($config, $tableName, \ReflectionClass $baseClass) |
||
64 | |||
65 | /** |
||
66 | * @param string $dns |
||
67 | * |
||
68 | * @return Client |
||
69 | */ |
||
70 | private function getOrCreateClient($dns) |
||
86 | } |
||
87 |