1 | <?php |
||
42 | class Configuration |
||
43 | { |
||
44 | const DEFAULT_GENERATED_CLASS_NAMESPACE = 'GeneratedHydratorGeneratedClass'; |
||
45 | |||
46 | /** |
||
47 | * @var string |
||
48 | */ |
||
49 | protected $hydratedClassName; |
||
50 | |||
51 | /** |
||
52 | * @var bool |
||
53 | */ |
||
54 | protected $autoGenerateProxies = true; |
||
55 | |||
56 | /** |
||
57 | * @var string|null |
||
58 | */ |
||
59 | protected $generatedClassesTargetDir; |
||
60 | |||
61 | /** |
||
62 | * @var string |
||
63 | */ |
||
64 | protected $generatedClassesNamespace = self::DEFAULT_GENERATED_CLASS_NAMESPACE; |
||
65 | |||
66 | /** |
||
67 | * @var \CodeGenerationUtils\GeneratorStrategy\GeneratorStrategyInterface|null |
||
68 | */ |
||
69 | protected $generatorStrategy; |
||
70 | |||
71 | /** |
||
72 | * @var callable|null |
||
73 | */ |
||
74 | protected $generatedClassesAutoloader; |
||
75 | |||
76 | /** |
||
77 | * @var \CodeGenerationUtils\Inflector\ClassNameInflectorInterface|null |
||
78 | */ |
||
79 | protected $classNameInflector; |
||
80 | |||
81 | /** |
||
82 | * @var \GeneratedHydrator\ClassGenerator\HydratorGeneratorInterface|null |
||
83 | */ |
||
84 | protected $hydratorGenerator; |
||
85 | |||
86 | /** |
||
87 | * @param string $hydratedClassName |
||
88 | */ |
||
89 | public function __construct(string $hydratedClassName) |
||
93 | |||
94 | /** |
||
95 | * @return \GeneratedHydrator\Factory\HydratorFactory |
||
96 | */ |
||
97 | 1 | public function createFactory() : HydratorFactory |
|
101 | |||
102 | /** |
||
103 | * @param string $hydratedClassName |
||
104 | */ |
||
105 | 1 | public function setHydratedClassName(string $hydratedClassName) |
|
109 | |||
110 | /** |
||
111 | * @return string |
||
112 | */ |
||
113 | 1 | public function getHydratedClassName() : string |
|
117 | |||
118 | /** |
||
119 | * @param bool $autoGenerateProxies |
||
120 | */ |
||
121 | 1 | public function setAutoGenerateProxies(bool $autoGenerateProxies) |
|
122 | { |
||
123 | 1 | $this->autoGenerateProxies = $autoGenerateProxies; |
|
124 | 1 | } |
|
125 | |||
126 | /** |
||
127 | * @return bool |
||
128 | */ |
||
129 | 1 | public function doesAutoGenerateProxies() : bool |
|
130 | { |
||
131 | 1 | return $this->autoGenerateProxies; |
|
132 | } |
||
133 | |||
134 | /** |
||
135 | * @param \CodeGenerationUtils\Autoloader\AutoloaderInterface $generatedClassesAutoloader |
||
136 | */ |
||
137 | 1 | public function setGeneratedClassAutoloader(AutoloaderInterface $generatedClassesAutoloader) |
|
138 | { |
||
139 | 1 | $this->generatedClassesAutoloader = $generatedClassesAutoloader; |
|
140 | 1 | } |
|
141 | |||
142 | /** |
||
143 | * @return \CodeGenerationUtils\Autoloader\AutoloaderInterface |
||
144 | * |
||
145 | * @throws \CodeGenerationUtils\Exception\InvalidGeneratedClassesDirectoryException |
||
146 | */ |
||
147 | 1 | public function getGeneratedClassAutoloader() : AutoloaderInterface |
|
148 | { |
||
149 | 1 | if (null === $this->generatedClassesAutoloader) { |
|
150 | 1 | $this->generatedClassesAutoloader = new Autoloader( |
|
151 | 1 | new FileLocator($this->getGeneratedClassesTargetDir()), |
|
152 | 1 | $this->getClassNameInflector() |
|
153 | ); |
||
154 | } |
||
155 | |||
156 | 1 | return $this->generatedClassesAutoloader; |
|
157 | } |
||
158 | |||
159 | /** |
||
160 | * @param string $generatedClassesNamespace |
||
161 | */ |
||
162 | 1 | public function setGeneratedClassesNamespace(string $generatedClassesNamespace) |
|
166 | |||
167 | /** |
||
168 | * @return string |
||
169 | */ |
||
170 | 1 | public function getGeneratedClassesNamespace() : string |
|
174 | |||
175 | /** |
||
176 | * @param string $generatedClassesTargetDir |
||
177 | */ |
||
178 | 1 | public function setGeneratedClassesTargetDir(string $generatedClassesTargetDir) |
|
182 | |||
183 | /** |
||
184 | * @return null|string |
||
185 | */ |
||
186 | 1 | public function getGeneratedClassesTargetDir() |
|
194 | |||
195 | /** |
||
196 | * @param \CodeGenerationUtils\GeneratorStrategy\GeneratorStrategyInterface $generatorStrategy |
||
197 | */ |
||
198 | 1 | public function setGeneratorStrategy(GeneratorStrategyInterface $generatorStrategy) |
|
202 | |||
203 | /** |
||
204 | * @return \CodeGenerationUtils\GeneratorStrategy\GeneratorStrategyInterface |
||
205 | * |
||
206 | * @throws \CodeGenerationUtils\Exception\InvalidGeneratedClassesDirectoryException |
||
207 | */ |
||
208 | 1 | public function getGeneratorStrategy() : GeneratorStrategyInterface |
|
218 | |||
219 | /** |
||
220 | * @param \CodeGenerationUtils\Inflector\ClassNameInflectorInterface $classNameInflector |
||
221 | */ |
||
222 | 1 | public function setClassNameInflector(ClassNameInflectorInterface $classNameInflector) |
|
226 | |||
227 | /** |
||
228 | * @return \CodeGenerationUtils\Inflector\ClassNameInflectorInterface |
||
229 | */ |
||
230 | 1 | public function getClassNameInflector() : ClassNameInflectorInterface |
|
238 | |||
239 | /** |
||
240 | * @param HydratorGeneratorInterface $hydratorGenerator |
||
241 | */ |
||
242 | 1 | public function setHydratorGenerator(HydratorGeneratorInterface $hydratorGenerator) |
|
246 | |||
247 | /** |
||
248 | * @return HydratorGeneratorInterface |
||
249 | */ |
||
250 | 1 | public function getHydratorGenerator() |
|
258 | } |
||
259 |