1 | <?php |
||
12 | final class SimpleRegistry implements ManagerRegistry |
||
13 | { |
||
14 | const DEFAULT_CONNECTION_NAME = 'default'; |
||
15 | const DEFAULT_MANAGER_NAME = 'default'; |
||
16 | |||
17 | /** |
||
18 | * @var Connection[] |
||
19 | */ |
||
20 | private $connections = []; |
||
21 | /** |
||
22 | * @var EntityManagerInterface[] |
||
23 | */ |
||
24 | private $managers = []; |
||
25 | /** |
||
26 | * Custom Entity=>Manager config |
||
27 | * @var array |
||
28 | */ |
||
29 | private $entityManagerMapping = []; |
||
30 | |||
31 | 58 | public function __construct( |
|
40 | |||
41 | /** |
||
42 | * @inheritdoc |
||
43 | */ |
||
44 | public function getDefaultConnectionName(): string |
||
48 | |||
49 | /** |
||
50 | * @inheritdoc |
||
51 | */ |
||
52 | public function getConnection($name = null): Connection |
||
64 | |||
65 | /** |
||
66 | * {@inheritdoc} |
||
67 | * @return Connection[] |
||
68 | */ |
||
69 | public function getConnections(): array |
||
73 | |||
74 | /** |
||
75 | * @inheritdoc |
||
76 | */ |
||
77 | public function getConnectionNames(): array |
||
81 | |||
82 | /** |
||
83 | * @inheritdoc |
||
84 | */ |
||
85 | 57 | public function getDefaultManagerName(): string |
|
89 | |||
90 | /** |
||
91 | * @inheritdoc |
||
92 | * @throws \Doctrine\ORM\ORMException |
||
93 | */ |
||
94 | 57 | public function getManager($name = null): EntityManagerInterface |
|
110 | |||
111 | /** |
||
112 | * {@inheritdoc} |
||
113 | * @return EntityManagerInterface[] |
||
114 | */ |
||
115 | public function getManagers(): array |
||
119 | |||
120 | /** |
||
121 | * @inheritdoc |
||
122 | * @throws \Doctrine\ORM\ORMException |
||
123 | */ |
||
124 | public function resetManager($name = null): EntityManagerInterface |
||
143 | |||
144 | /** |
||
145 | * @inheritdoc |
||
146 | * @unsupported |
||
147 | */ |
||
148 | public function getAliasNamespace($alias): string |
||
152 | |||
153 | /** |
||
154 | * @inheritdoc |
||
155 | */ |
||
156 | public function getManagerNames(): array |
||
160 | |||
161 | /** |
||
162 | * @inheritdoc |
||
163 | * @throws \Doctrine\ORM\ORMException |
||
164 | */ |
||
165 | 57 | public function getRepository($persistentObject, $persistentManagerName = null): ObjectRepository |
|
174 | |||
175 | /** |
||
176 | * @inheritdoc |
||
177 | * @throws \Doctrine\ORM\ORMException |
||
178 | */ |
||
179 | 57 | public function getManagerForClass($class): EntityManagerInterface |
|
185 | } |
||
186 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: