@@ 21-46 (lines=26) @@ | ||
18 | /** |
|
19 | * @author Beñat Espiña <[email protected]> |
|
20 | */ |
|
21 | class GetFileRoutesLoader extends RoutesLoader |
|
22 | { |
|
23 | public function supports($resource, $type = null) |
|
24 | { |
|
25 | return 'bengor_file_get_file_api' === $type; |
|
26 | } |
|
27 | ||
28 | protected function register($file, array $config) |
|
29 | { |
|
30 | $this->routes->add( |
|
31 | $config['api_name'], |
|
32 | new Route( |
|
33 | $config['api_path'], |
|
34 | [ |
|
35 | '_controller' => 'BenGorFileBundle:Api\GetFile:byId', |
|
36 | 'fileClass' => $file, |
|
37 | ], |
|
38 | [], |
|
39 | [], |
|
40 | '', |
|
41 | [], |
|
42 | ['GET'] |
|
43 | ) |
|
44 | ); |
|
45 | } |
|
46 | } |
|
47 |
@@ 21-46 (lines=26) @@ | ||
18 | /** |
|
19 | * @author Beñat Espiña <[email protected]> |
|
20 | */ |
|
21 | class GetFilesRoutesLoader extends RoutesLoader |
|
22 | { |
|
23 | public function supports($resource, $type = null) |
|
24 | { |
|
25 | return 'bengor_file_get_files_api' === $type; |
|
26 | } |
|
27 | ||
28 | protected function register($file, array $config) |
|
29 | { |
|
30 | $this->routes->add( |
|
31 | $config['api_name'], |
|
32 | new Route( |
|
33 | $config['api_path'], |
|
34 | [ |
|
35 | '_controller' => 'BenGorFileBundle:Api\GetFiles:byIds', |
|
36 | 'fileClass' => $file, |
|
37 | ], |
|
38 | [], |
|
39 | [], |
|
40 | '', |
|
41 | [], |
|
42 | ['GET'] |
|
43 | ) |
|
44 | ); |
|
45 | } |
|
46 | } |
|
47 |