| @@ 57-61 (lines=5) @@ | ||
| 54 | $fieldIdentifier, |
|
| 55 | $request->query->has('inLanguage') ? $request->query->get('inLanguage') : null |
|
| 56 | ); |
|
| 57 | if (!$field instanceof Field) { |
|
| 58 | throw new InvalidArgumentException( |
|
| 59 | "'{$fieldIdentifier}' field not present on content #{$content->contentInfo->id} '{$content->contentInfo->name}'" |
|
| 60 | ); |
|
| 61 | } |
|
| 62 | ||
| 63 | $response = new BinaryStreamResponse($this->ioService->loadBinaryFile($field->value->id), $this->ioService); |
|
| 64 | $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_ATTACHMENT, $filename); |
|
| @@ 123-128 (lines=6) @@ | ||
| 120 | public function renderField(Content $content, $fieldIdentifier, array $params = []) |
|
| 121 | { |
|
| 122 | $field = $this->translationHelper->getTranslatedField($content, $fieldIdentifier, isset($params['lang']) ? $params['lang'] : null); |
|
| 123 | if (!$field instanceof Field) { |
|
| 124 | throw new InvalidArgumentException( |
|
| 125 | '$fieldIdentifier', |
|
| 126 | "'{$fieldIdentifier}' field not present on content #{$content->contentInfo->id} '{$content->contentInfo->name}'" |
|
| 127 | ); |
|
| 128 | } |
|
| 129 | ||
| 130 | $params = $this->getRenderFieldBlockParameters($content, $field, $params); |
|
| 131 | $fieldTypeIdentifier = $this->getFieldTypeIdentifier($content, $field); |
|