1 | <?php |
||
11 | class ContainerService |
||
12 | { |
||
13 | /** |
||
14 | * @var Container |
||
15 | */ |
||
16 | private $container; |
||
17 | |||
18 | /** |
||
19 | * @var DbCredentials |
||
20 | */ |
||
21 | private $credentials; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | private $paths; |
||
27 | |||
28 | /** @var string $proxyPath */ |
||
29 | private $proxyPath; |
||
30 | |||
31 | /** @var \Doctrine\ORM\Configuration $config */ |
||
32 | private $config; |
||
33 | |||
34 | private function __construct(){} |
||
36 | |||
37 | /** |
||
38 | * @param Container|null $container |
||
39 | * @return ContainerService|null |
||
40 | */ |
||
41 | 9 | public static function getInstance(Container $container = null) |
|
52 | |||
53 | /** |
||
54 | * by default looks for src/Entity |
||
55 | * or src/anything/Entity |
||
56 | * |
||
57 | * @return array |
||
58 | */ |
||
59 | 1 | private function initEntityPaths(): array |
|
71 | |||
72 | /** |
||
73 | * @param array $paths |
||
74 | * @param string $path |
||
75 | * @return array |
||
76 | */ |
||
77 | 1 | private function addPathIfExists(array $paths, string $path): array |
|
85 | |||
86 | |||
87 | /** |
||
88 | * @return Container |
||
89 | * @throws \Doctrine\ORM\ORMException |
||
90 | */ |
||
91 | 7 | public function getContainer() |
|
114 | |||
115 | 7 | private function addProxyPath() |
|
121 | |||
122 | |||
123 | /** |
||
124 | * @param string $path |
||
125 | * @return $this |
||
126 | */ |
||
127 | 3 | public function addEntityPath($path) |
|
135 | |||
136 | /** |
||
137 | * @return array |
||
138 | */ |
||
139 | 8 | public function getEntityPaths() |
|
143 | |||
144 | /** |
||
145 | * @param string $proxyPath |
||
146 | * @return ContainerService |
||
147 | */ |
||
148 | 1 | public function setProxyPath($proxyPath) |
|
153 | |||
154 | |||
155 | /** |
||
156 | * @return DbCredentials |
||
157 | */ |
||
158 | 8 | public function getDbCredentials() |
|
162 | |||
163 | /** |
||
164 | * @param DbCredentials $credentials |
||
165 | * @return $this |
||
166 | */ |
||
167 | 3 | public function setDbCredentials(DbCredentials $credentials) |
|
172 | |||
173 | /** |
||
174 | * @param RegistrationInterface $config |
||
175 | */ |
||
176 | 2 | public function registerToContainer(RegistrationInterface $config) |
|
184 | } |
||
185 |