| 12345678910111213141516171819202122232425262728 |
- <?php
- declare(strict_types=1);
- namespace App\Service\File\Storage;
- use App\Entity\Core\File;
- use App\Service\ApiLegacy\ApiLegacyRequestService;
- /**
- * Read and write files into the Opentalent API v1 storage
- */
- class ApiLegacyStorage implements FileStorageInterface
- {
- public function __construct(private ApiLegacyRequestService $apiLegacyRequestService)
- {}
- /**
- * Reads the given file and returns its content as a string
- *
- * @param File $file
- * @return string
- */
- public function read(File $file): string
- {
- $url = '_internal/secure/files/' . $file->getId();
- return $this->apiLegacyRequestService->getContent($url);
- }
- }
|