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() |
|
47 | |||
48 | |||
49 | /** |
||
50 | * @return PimpleContainer |
||
51 | */ |
||
52 | 7 | public function getContainer() |
|
74 | |||
75 | 7 | private function addProxyPath() |
|
76 | { |
||
77 | 7 | if(isset($this->proxyPath)) { |
|
78 | 1 | $this->config->setProxyDir($this->proxyPath); |
|
79 | 1 | } |
|
80 | 7 | } |
|
81 | |||
82 | |||
83 | |||
84 | /** |
||
85 | * @param string $path |
||
86 | * @return $this |
||
87 | */ |
||
88 | 4 | public function addEntityPath($path) |
|
93 | |||
94 | /** |
||
95 | * @return array |
||
96 | */ |
||
97 | 8 | public function getEntityPaths() |
|
101 | |||
102 | /** |
||
103 | * @param string $proxyPath |
||
104 | * @return ContainerService |
||
105 | */ |
||
106 | 2 | public function setProxyPath($proxyPath) |
|
107 | { |
||
108 | 1 | $this->proxyPath = $proxyPath; |
|
109 | 2 | return $this; |
|
110 | } |
||
111 | |||
112 | |||
113 | |||
114 | /** |
||
115 | * @return DbCredentials |
||
116 | */ |
||
117 | 8 | public function getDbCredentials() |
|
121 | |||
122 | /** |
||
123 | * @param DbCredentials $credentials |
||
124 | * @return $this |
||
125 | */ |
||
126 | 3 | public function setDbCredentials(DbCredentials $credentials) |
|
131 | |||
132 | |||
133 | 2 | public function registerToContainer(RegistrationInterface $config) |
|
140 | } |
||
141 |