1 | <?php |
||
28 | class MediaController extends Controller |
||
|
|||
29 | { |
||
30 | /** |
||
31 | * @return MediaProviderInterface |
||
32 | */ |
||
33 | public function getProvider(MediaInterface $media) |
||
34 | { |
||
35 | return $this->get('sonata.media.pool')->getProvider($media->getProviderName()); |
||
36 | } |
||
37 | |||
38 | /** |
||
39 | * @param string $id |
||
40 | * |
||
41 | * @return MediaInterface |
||
42 | */ |
||
43 | public function getMedia($id) |
||
44 | { |
||
45 | return $this->get('sonata.media.manager.media')->find($id); |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @param string $id |
||
50 | * @param string $format |
||
51 | * |
||
52 | * @throws NotFoundHttpException |
||
53 | * |
||
54 | * @return Response |
||
55 | */ |
||
56 | public function downloadAction(Request $request, $id, $format = MediaProviderInterface::FORMAT_REFERENCE) |
||
76 | |||
77 | /** |
||
78 | * @param string $id |
||
79 | * @param string $format |
||
80 | * |
||
81 | * @throws NotFoundHttpException |
||
82 | * |
||
83 | * @return Response |
||
84 | */ |
||
85 | public function viewAction(Request $request, $id, $format = MediaProviderInterface::FORMAT_REFERENCE) |
||
103 | |||
104 | /** |
||
105 | * NEXT_MAJOR: remove this method. |
||
106 | * |
||
107 | * This action applies a given filter to a given image, |
||
108 | * optionally saves the image and |
||
109 | * outputs it to the browser at the same time. |
||
110 | * |
||
111 | * @param string $path |
||
112 | * @param string $filter |
||
113 | * |
||
114 | * @return Response |
||
115 | * |
||
116 | * @deprecated since sonata-project/media-bundle 3.12, to be removed in 4.0. |
||
117 | */ |
||
118 | public function liipImagineFilterAction(Request $request, $path, $filter) |
||
158 | } |
||
159 |
This class, trait or interface has been deprecated. The supplier of the file has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the type will be removed from the class and what other constant to use instead.