Webiny\Component\Amazon\S3::getListObjectsIterator PHP Method

getListObjectsIterator() public method

Get objects iterator
public getListObjectsIterator ( string $bucket, array $params = [] ) : mixed
$bucket string
$params array
return mixed
    public function getListObjectsIterator($bucket, array $params = [])
    {
        return $this->instance->getListObjectsIterator($bucket, $params);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function getKeys($key = '', $recursive = false)
 {
     $s3Data = ['Prefix' => $key];
     $iterator = $this->s3Client->getListObjectsIterator($this->bucket, $s3Data);
     $files = [];
     foreach ($iterator as $file) {
         $files[] = $file['Key'];
     }
     return $files;
 }