getId()); return $this->apiLegacyRequestService->getContent($url); } /** * Retoune l'URL de l'image, à la bonne taille, contenu dans la File. */ public function getImageUrl(File $file, string $size, bool $relativePath): string { $url = sprintf('api/files/%s/download/%s?relativePath=1', $file->getId(), $size); // L'url interne est l'équivalent d'un chemin relatif dans ce cas $baseUrl = $relativePath ? $this->legacyBaseUrl : $this->publicLegacyBaseUrl; return UrlBuilder::concat($baseUrl, [$this->apiLegacyRequestService->getContent($url)], []); } public function support(File $file): bool { return $file->getHost() === FileHostEnum::API1; } /** * Permanently delete the entire file storage of the given Organization. */ public function deleteOrganizationFiles(int $organizationId): void { $url = sprintf('/_internal/request/organization-files/delete/%s', $organizationId); $this->apiLegacyRequestService->get($url); } /** * Permanently delete the entire file storage of the given Person. */ public function deletePersonFiles(int $personId): void { $url = sprintf('/_internal/request/person-files/delete/%s', $personId); $this->apiLegacyRequestService->get($url); } }