@@ 39-49 (lines=11) @@ | ||
36 | * @param $id |
|
37 | * @return StreamedResponse |
|
38 | */ |
|
39 | public function downloadAction(Request $request, $id) |
|
40 | { |
|
41 | $object = $this->admin->getObject($id); |
|
42 | ||
43 | $this->admin->checkAccess('show', $object); |
|
44 | ||
45 | return $this->get('mediamonks.sonata_media.utility.download')->getStreamedResponse($object, new DownloadParameterBag($request->query->all())); |
|
46 | } |
|
47 | ||
48 | /** |
|
49 | * @param Request $request |
|
50 | * @param int $id |
|
51 | * @return RedirectResponse |
|
52 | */ |
|
@@ 53-63 (lines=11) @@ | ||
50 | * @param int $id |
|
51 | * @return RedirectResponse |
|
52 | */ |
|
53 | public function imageAction(Request $request, $id, $width, $height) |
|
54 | { |
|
55 | $object = $this->admin->getObject($id); |
|
56 | ||
57 | $this->admin->checkAccess('show', $object); |
|
58 | ||
59 | return $this->get('mediamonks.sonata_media.utility.image')->getRedirectResponse($object, new ImageParameterBag($width, $height, $request->query->all())); |
|
60 | } |
|
61 | } |
|
62 |