Webiny\Component\Amazon\Bridge\S3\S3::deleteObjects PHP Method

deleteObjects() public method

You may specify up to 1000 keys.
public deleteObjects ( string $bucket, array $objects ) : mixed
$bucket string
$objects array
return mixed
    public function deleteObjects($bucket, array $objects)
    {
        $params = ['Bucket' => $bucket, 'Objects' => []];
        foreach ($objects as $object) {
            $objects[] = ['Key' => $object];
        }
        return $this->instance->deleteObjects($params);
    }

Usage Example

Beispiel #1
0
 /**
  * This operation enables you to delete multiple objects from a bucket using a single HTTP request.
  * You may specify up to 1000 keys.
  *
  * @param string $bucket
  * @param array  $objects
  *
  * @return mixed
  */
 public function deleteObjects($bucket, array $objects)
 {
     return $this->instance->deleteObjects($bucket, $objects);
 }