/** * Factory method to create a new BucketIterator using the response of a * listBucket request. * * @param S3Client $client The client responsible for sending subsquent requests * @param \SimpleXMLElement $bucketResult The initial XML response from a * list bucket command * @param int $limit (optional) Total number of results to retrieve * * @return BucketIterator */ public static function factory(S3Client $client, \SimpleXMLElement $bucketResult, $limit = -1) { $iterator = new self($client, array('limit' => $limit, 'page_size' => min(1000, $limit))); $iterator->processListBucket($bucketResult); return $iterator; }