Documentation

DeleteObjectsBatch extends AbstractBatchDecorator
in package

The DeleteObjectsBatch is a BatchDecorator for Guzzle that implements a queue for deleting keys from an Amazon S3 bucket. You can add DeleteObject or an array of [Key => %s, VersionId => %s] and call flush when the objects should be deleted.

Table of Contents

Properties

$decoratedBatch  : BatchInterface

Methods

__call()  : mixed
Allow decorators to implement custom methods
__construct()  : mixed
add()  : self
Add an item to the queue
addKey()  : $this
Add an object to be deleted
factory()  : static
Factory for creating a DeleteObjectsBatch
flush()  : array<string|int, mixed>
Flush the batch and transfer the items
getDecorators()  : array<string|int, mixed>
Trace the decorators associated with the batch
isEmpty()  : bool
Check if the batch is empty and has further items to transfer

Properties

Methods

__call()

Allow decorators to implement custom methods

public __call(string $method, array<string|int, mixed> $args) : mixed
Parameters
$method : string

Missing method name

$args : array<string|int, mixed>

Method arguments

Tags
codeCoverageIgnore

add()

Add an item to the queue

public add(mixed $item) : self
Parameters
$item : mixed

Item to add

Return values
self

addKey()

Add an object to be deleted

public addKey(string $key[, string $versionId = null ]) : $this
Parameters
$key : string

Key of the object

$versionId : string = null

VersionID of the object

Return values
$this

factory()

Factory for creating a DeleteObjectsBatch

public static factory(AwsClientInterface $client, string $bucket[, string $mfa = null ]) : static
Parameters
$client : AwsClientInterface

Client used to transfer requests

$bucket : string

Bucket that contains the objects to delete

$mfa : string = null

MFA token to use with the request

Return values
static

flush()

Flush the batch and transfer the items

public flush() : array<string|int, mixed>
Return values
array<string|int, mixed>

Returns an array flushed items

getDecorators()

Trace the decorators associated with the batch

public getDecorators() : array<string|int, mixed>
Return values
array<string|int, mixed>

isEmpty()

Check if the batch is empty and has further items to transfer

public isEmpty() : bool
Return values
bool

        
On this page

Search results