Class ClearBucket
Class used to clear the contents of a bucket or the results of an iterator
- Guzzle\Common\AbstractHasDispatcher implements Guzzle\Common\HasDispatcherInterface
- Aws\S3\Model\ClearBucket
Methods summary
-
public
__construct ( Aws\Common\Client\AwsClientInterface $client, string $bucket )
-
public static
getAllEvents ( )
Get a list of all of the events emitted from the class
-
public
setBucket ( string $bucket )
Set the bucket that is to be cleared
-
public
getIterator ( )
Get the iterator used to yield the keys to be deleted. A default iterator will be created and returned if no iterator has been explicitly set.
-
public
setIterator ( Iterator $iterator )
Sets a different iterator to use than the default iterator. This can be helpful when you wish to delete only specific keys from a bucket (e.g. keys that match a certain prefix or delimiter, or perhaps keys that pass through a filtered, decorated iterator).
-
public
setMfa ( string $mfa )
Set the MFA token to send with each request
-
public
clear ( )
Clear the bucket
Methods detail
Parameters
- $client
Aws\Common\Client\AwsClientInterface
$client Client used to execute requests- $bucket
string
$bucket Name of the bucket to clear
Get a list of all of the events emitted from the class
Returns
array
Overrides
Set the bucket that is to be cleared
Parameters
- $bucket
string
$bucket Name of the bucket to clear
Returns
mixed
$this
Get the iterator used to yield the keys to be deleted. A default iterator will be created and returned if no iterator has been explicitly set.
Returns
Sets a different iterator to use than the default iterator. This can be helpful when you wish to delete only specific keys from a bucket (e.g. keys that match a certain prefix or delimiter, or perhaps keys that pass through a filtered, decorated iterator).
Parameters
- $iterator
Iterator
$iterator Iterator used to yield the keys to be deleted
Returns
mixed
$this
Set the MFA token to send with each request
Parameters
- $mfa
string
$mfa MFA token to send with each request. The value is the concatenation of the authentication device's serial number, a space, and the value displayed on your authentication device.
Returns
mixed
$this
Clear the bucket
Returns
integer
Returns the number of deleted keys
Throws
Methods inherited from Guzzle\Common\AbstractHasDispatcher
addSubscriber()
,
dispatch()
,
getEventDispatcher()
,
setEventDispatcher()
Magic methods summary
Constants summary
string |
AFTER_DELETE |
'clear_bucket.after_delete' |
#
Event emitted when a batch request has completed |
string |
BEFORE_CLEAR |
'clear_bucket.before_clear' |
#
Event emitted before the bucket is cleared |
string |
AFTER_CLEAR |
'clear_bucket.after_clear' |
#
Event emitted after the bucket is cleared |
Properties summary
protected
|
$client |
#
Client used to execute the requests |
protected
AbstractS3ResourceIterator
|
$iterator |
#
Iterator used to yield keys |
protected
string
|
$mfa |
#
MFA used with each request |