1 | <?php |
||
17 | class Configuration implements ConfigurationInterface |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * @var string |
||
22 | */ |
||
23 | private $beanNamespace; |
||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $daoNamespace; |
||
28 | /** |
||
29 | * @var Connection |
||
30 | */ |
||
31 | private $connection; |
||
32 | /** |
||
33 | * @var Cache |
||
34 | */ |
||
35 | private $cache; |
||
36 | /** |
||
37 | * @var SchemaAnalyzer |
||
38 | */ |
||
39 | private $schemaAnalyzer; |
||
40 | /** |
||
41 | * @var LoggerInterface |
||
42 | */ |
||
43 | private $logger; |
||
44 | /** |
||
45 | * @var GeneratorListenerInterface |
||
46 | */ |
||
47 | private $generatorEventDispatcher; |
||
48 | /** |
||
49 | * @var NamingStrategyInterface |
||
50 | */ |
||
51 | private $namingStrategy; |
||
52 | /** |
||
53 | * @var PathFinderInterface |
||
54 | */ |
||
55 | private $pathFinder; |
||
56 | /** |
||
57 | * The Composer file used to detect the path where files should be written. |
||
58 | * |
||
59 | * @var string |
||
60 | */ |
||
61 | private $composerFile; |
||
62 | |||
63 | /** |
||
64 | * @param string $beanNamespace The namespace hosting the beans |
||
65 | * @param string $daoNamespace The namespace hosting the DAOs |
||
66 | * @param Connection $connection The connection to the database |
||
67 | * @param Cache|null $cache The Doctrine cache to store database metadata |
||
68 | * @param SchemaAnalyzer|null $schemaAnalyzer The schema analyzer that will be used to find shortest paths... Will be automatically created if not passed |
||
69 | * @param LoggerInterface|null $logger The logger |
||
70 | * @param GeneratorListenerInterface[] $generatorListeners A list of listeners that will be triggered when beans/daos are generated |
||
71 | */ |
||
72 | public function __construct(string $beanNamespace, string $daoNamespace, Connection $connection, NamingStrategyInterface $namingStrategy, Cache $cache = null, SchemaAnalyzer $schemaAnalyzer = null, LoggerInterface $logger = null, array $generatorListeners = []) |
||
92 | |||
93 | /** |
||
94 | * @return string |
||
95 | */ |
||
96 | public function getBeanNamespace(): string |
||
100 | |||
101 | /** |
||
102 | * @return string |
||
103 | */ |
||
104 | public function getDaoNamespace(): string |
||
108 | |||
109 | /** |
||
110 | * @return Connection |
||
111 | */ |
||
112 | public function getConnection(): Connection |
||
116 | |||
117 | /** |
||
118 | * @return NamingStrategyInterface |
||
119 | */ |
||
120 | public function getNamingStrategy(): NamingStrategyInterface |
||
124 | |||
125 | /** |
||
126 | * @return Cache |
||
127 | */ |
||
128 | public function getCache(): Cache |
||
132 | |||
133 | /** |
||
134 | * @return SchemaAnalyzer |
||
135 | */ |
||
136 | public function getSchemaAnalyzer(): SchemaAnalyzer |
||
140 | |||
141 | /** |
||
142 | * @return LoggerInterface |
||
143 | */ |
||
144 | public function getLogger(): ?LoggerInterface |
||
148 | |||
149 | /** |
||
150 | * @return GeneratorListenerInterface |
||
151 | */ |
||
152 | public function getGeneratorEventDispatcher(): GeneratorListenerInterface |
||
156 | |||
157 | |||
158 | |||
159 | /** |
||
160 | * Creates a unique cache key for the current connection. |
||
161 | * |
||
162 | * @return string |
||
163 | */ |
||
164 | private function getConnectionUniqueId(): string |
||
168 | |||
169 | /** |
||
170 | * Returns a class able to find the place of a PHP file based on the class name. |
||
171 | * Useful to find the path where DAOs and beans should be written to. |
||
172 | * |
||
173 | * @return PathFinderInterface |
||
174 | */ |
||
175 | public function getPathFinder(): PathFinderInterface |
||
179 | |||
180 | /** |
||
181 | * @param PathFinderInterface $pathFinder |
||
182 | */ |
||
183 | public function setPathFinder(PathFinderInterface $pathFinder) |
||
187 | } |
||
188 |