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 | /** |
||
58 | * @param string $beanNamespace The namespace hosting the beans |
||
59 | * @param string $daoNamespace The namespace hosting the DAOs |
||
60 | * @param Connection $connection The connection to the database |
||
61 | * @param Cache|null $cache The Doctrine cache to store database metadata |
||
62 | * @param SchemaAnalyzer|null $schemaAnalyzer The schema analyzer that will be used to find shortest paths... Will be automatically created if not passed |
||
63 | * @param LoggerInterface|null $logger The logger |
||
64 | * @param GeneratorListenerInterface[] $generatorListeners A list of listeners that will be triggered when beans/daos are generated |
||
65 | */ |
||
66 | public function __construct(string $beanNamespace, string $daoNamespace, Connection $connection, NamingStrategyInterface $namingStrategy, Cache $cache = null, SchemaAnalyzer $schemaAnalyzer = null, LoggerInterface $logger = null, array $generatorListeners = []) |
||
86 | |||
87 | /** |
||
88 | * @return string |
||
89 | */ |
||
90 | public function getBeanNamespace(): string |
||
94 | |||
95 | /** |
||
96 | * @return string |
||
97 | */ |
||
98 | public function getDaoNamespace(): string |
||
102 | |||
103 | /** |
||
104 | * @return Connection |
||
105 | */ |
||
106 | public function getConnection(): Connection |
||
110 | |||
111 | /** |
||
112 | * @return NamingStrategyInterface |
||
113 | */ |
||
114 | public function getNamingStrategy(): NamingStrategyInterface |
||
118 | |||
119 | /** |
||
120 | * @return Cache |
||
121 | */ |
||
122 | public function getCache(): Cache |
||
126 | |||
127 | /** |
||
128 | * @return SchemaAnalyzer |
||
129 | */ |
||
130 | public function getSchemaAnalyzer(): SchemaAnalyzer |
||
134 | |||
135 | /** |
||
136 | * @return LoggerInterface |
||
137 | */ |
||
138 | public function getLogger(): ?LoggerInterface |
||
142 | |||
143 | /** |
||
144 | * @return GeneratorListenerInterface |
||
145 | */ |
||
146 | public function getGeneratorEventDispatcher(): GeneratorListenerInterface |
||
150 | |||
151 | |||
152 | |||
153 | /** |
||
154 | * Creates a unique cache key for the current connection. |
||
155 | * |
||
156 | * @return string |
||
157 | */ |
||
158 | private function getConnectionUniqueId(): string |
||
162 | |||
163 | /** |
||
164 | * Returns a class able to find the place of a PHP file based on the class name. |
||
165 | * Useful to find the path where DAOs and beans should be written to. |
||
166 | * |
||
167 | * @return PathFinderInterface |
||
168 | */ |
||
169 | public function getPathFinder(): PathFinderInterface |
||
173 | |||
174 | /** |
||
175 | * @param PathFinderInterface $pathFinder |
||
176 | */ |
||
177 | public function setPathFinder(PathFinderInterface $pathFinder) |
||
181 | } |
||
182 |