Example #1
0
 /**
  * Turn this item object into a generic array
  *
  * @return array
  */
 public function transform(File $file = null)
 {
     if ($file === null) {
         return [];
     }
     return ['id' => (int) $file->getId(), 'mimeType' => $file->getMimeType(), 'size' => $file->getSize(), 'name' => $file->getName(), 'uri' => $file->getUri()];
 }
Example #2
0
 public function getDownloadUrl(File $file)
 {
     $cmd = $this->s3Client->getCommand('GetObject', ['Bucket' => $this->bucket, 'Key' => $file->getUri()]);
     $request = $this->s3Client->createPresignedRequest($cmd, '+12 hours');
     return (string) $request->getUri();
 }