1 | <?php |
||
15 | class CodeGenerator { |
||
16 | |||
17 | protected $config; |
||
18 | |||
19 | /** |
||
20 | * @var GeneratorStrategy |
||
21 | */ |
||
22 | protected $strategy; |
||
23 | |||
24 | /** |
||
25 | * |
||
26 | * @param CodeGeneratorConfig|array $config |
||
27 | */ |
||
28 | 10 | public function __construct($config = null) { |
|
39 | |||
40 | 16 | protected function init() { |
|
44 | |||
45 | /** |
||
46 | * Returns the used configuration |
||
47 | * |
||
48 | * @return CodeGeneratorConfig |
||
49 | */ |
||
50 | public function getConfig() { |
||
53 | |||
54 | /** |
||
55 | * Returns the used generator strategy |
||
56 | * |
||
57 | * @return DefaultGeneratorStrategy |
||
58 | */ |
||
59 | public function getGeneratorStrategy() { |
||
62 | |||
63 | /** |
||
64 | * Generates code from a given model |
||
65 | * |
||
66 | * @param GenerateableInterface $model |
||
67 | * @return string the generated code |
||
68 | */ |
||
69 | 16 | public function generate(GenerateableInterface $model) { |
|
76 | |||
77 | } |
||
78 |