1 | <?php |
||
7 | class Generator |
||
8 | { |
||
9 | /** |
||
10 | * @type string location of the base EloquentJs build |
||
11 | */ |
||
12 | const BASE_BUILD = __DIR__.'/../../eloquent.js'; |
||
13 | |||
14 | /** |
||
15 | * Generate EloquentJs javascript for the given models. |
||
16 | * |
||
17 | * @param array $models |
||
18 | * @return string |
||
19 | */ |
||
20 | public function build(array $models) |
||
24 | |||
25 | /** |
||
26 | * Get prefix for our javascript build. |
||
27 | * |
||
28 | * @return string |
||
29 | */ |
||
30 | protected function prefix() |
||
35 | |||
36 | /** |
||
37 | * Get custom model definitions for build. |
||
38 | * |
||
39 | * @param array $models |
||
40 | * @return string |
||
41 | */ |
||
42 | protected function models(array $models) |
||
46 | |||
47 | /** |
||
48 | * Get suffix for our javascript build. |
||
49 | * |
||
50 | * @return string |
||
51 | */ |
||
52 | protected function suffix() |
||
56 | |||
57 | /** |
||
58 | * Generate javascript to describe the given model. |
||
59 | * |
||
60 | * @param Metadata $model |
||
61 | * @return string |
||
62 | */ |
||
63 | protected function model(Metadata $model) |
||
73 | } |
||
74 |