1 | <?php |
||
12 | class FileBuilder extends PipelineBuilder |
||
13 | { |
||
14 | public static function getPipelineWithOutput($output) |
||
22 | |||
23 | // public function run($eloquentClasses) |
||
24 | // { |
||
25 | |||
26 | |||
27 | // $tables = (new Pipeline) |
||
28 | // // Retorna Todas as Tabelas |
||
29 | // ->pipe(new TablesParser) |
||
30 | // // Mapea as Tabelas |
||
31 | // ->pipe(new TablesBuilder) |
||
32 | // // Builda e Retorna o Entity |
||
33 | // ->pipe(new TablesMount); |
||
34 | |||
35 | // // Returns 21 |
||
36 | // $entitys = $pipeline->process(10); |
||
37 | |||
38 | |||
39 | |||
40 | // } |
||
41 | // public function runTwo($eloquentClasses) |
||
42 | // { |
||
43 | |||
44 | |||
45 | // $tables = (new Pipeline) |
||
46 | // ->pipe(new DatabaseRender) |
||
47 | // ->pipe(new DatabaseMount); |
||
48 | |||
49 | // // Returns 21 |
||
50 | // $entitys = $pipeline->process(10); |
||
51 | |||
52 | |||
53 | |||
54 | // // Re-usable Pipelines |
||
55 | // // Because the PipelineInterface is an extension of the StageInterface pipelines can be re-used as stages. This creates a highly composable model to create complex execution patterns while keeping the cognitive load low. |
||
56 | |||
57 | // // For example, if we'd want to compose a pipeline to process API calls, we'd create something along these lines: |
||
58 | |||
59 | // $databaseEntity = (new Pipeline) |
||
60 | // ->pipe(new ExecuteHttpRequest) // 2 |
||
61 | // ->pipe(new ParseJsonResponse); // 3 |
||
62 | |||
63 | // $pipeline = (new Pipeline) |
||
64 | // ->pipe(new ConvertToPsr7Request) // 1 |
||
65 | // ->pipe($processApiRequest) // (2,3) |
||
66 | // ->pipe(new ConvertToResponseDto); // 4 |
||
67 | |||
68 | // $pipeline->process(new DeleteBlogPost($postId)); |
||
69 | // } |
||
70 | } |