1 | <?php |
||
10 | class ContainerService |
||
11 | { |
||
12 | /** |
||
13 | * @var PimpleContainer |
||
14 | */ |
||
15 | private $container; |
||
16 | |||
17 | /** |
||
18 | * @var DbCredentials |
||
19 | */ |
||
20 | private $credentials; |
||
21 | |||
22 | /** |
||
23 | * @var array |
||
24 | */ |
||
25 | private $paths; |
||
26 | |||
27 | /** @var string $proxyPath */ |
||
28 | private $proxyPath; |
||
29 | |||
30 | /** @var \Doctrine\ORM\Configuration $config */ |
||
31 | private $config; |
||
32 | |||
33 | public function __construct(){} |
||
35 | |||
36 | 9 | public static function getInstance() |
|
48 | |||
49 | /** |
||
50 | * by default looks for src/Entity |
||
51 | * or src/anything/Entity |
||
52 | * |
||
53 | * @return array |
||
54 | */ |
||
55 | 1 | private function initEntityPaths(): array |
|
67 | |||
68 | /** |
||
69 | * @param array $paths |
||
70 | * @param string $path |
||
71 | * @return array |
||
72 | */ |
||
73 | 1 | private function addPathIfExists(array $paths, string $path): array |
|
81 | |||
82 | |||
83 | /** |
||
84 | * @return PimpleContainer |
||
85 | */ |
||
86 | 7 | public function getContainer() |
|
108 | |||
109 | 7 | private function addProxyPath() |
|
115 | |||
116 | |||
117 | |||
118 | /** |
||
119 | * @param string $path |
||
120 | * @return $this |
||
121 | */ |
||
122 | 4 | public function addEntityPath($path) |
|
130 | |||
131 | /** |
||
132 | * @return array |
||
133 | */ |
||
134 | 8 | public function getEntityPaths() |
|
138 | |||
139 | /** |
||
140 | * @param string $proxyPath |
||
141 | * @return ContainerService |
||
142 | */ |
||
143 | 1 | public function setProxyPath($proxyPath) |
|
148 | |||
149 | |||
150 | |||
151 | /** |
||
152 | * @return DbCredentials |
||
153 | */ |
||
154 | 8 | public function getDbCredentials() |
|
158 | |||
159 | /** |
||
160 | * @param DbCredentials $credentials |
||
161 | * @return $this |
||
162 | */ |
||
163 | 3 | public function setDbCredentials(DbCredentials $credentials) |
|
168 | |||
169 | |||
170 | 2 | public function registerToContainer(RegistrationInterface $config) |
|
177 | } |
||
178 |