listObjects([ 'Bucket' => self::getBucket(), 'Prefix' => 'wash_certificate_' . $certificate_id . '.pdf' ]); return count($objects['Contents'] ?? []) > 0; } public function getWashCertificateDownload(int $id): string { return self::getPresignedUrl('wash_certificate_' . $id . '.pdf'); } /** * @param string $file * @return string The path to the downloaded file */ public function download(string $file): string { $path = '/tmp/' . $file; $result = self::getS3Client()->getObject([ 'Bucket' => self::getBucket(), 'Key' => $file, 'SaveAs' => $path ]); return $path; } }