public function deleteBucket($bucketName)
{
$result = false;
$options = array('_subdomain' => (string) $bucketName);
$response = $this->client->call('DELETE', $options, '/');
if ($response->getError() === false) {
$result = true;
$bucket = $this->s3->bucket->get((string) $bucketName);
if ($bucket instanceof BucketData) {
$this->getEntityManager()->detach($bucket);
}
}
return $result;
}