Skip to content

Commit 1902104

Browse files
author
Jamie Hannaford
authored
Merge pull request #133 from ekasitk/download-options
[rfr] Add swift download options
2 parents 5e20f72 + 999bacf commit 1902104

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/ObjectStore/v1/Models/Object.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,13 +108,19 @@ public function retrieve()
108108
* distinct from fetching its metadata (a `HEAD` request). The body of an object is not fetched by default to
109109
* improve performance when handling large objects.
110110
*
111+
* @param array $data {@see \OpenStack\ObjectStore\v1\Api::getObject}
112+
*
111113
* @return StreamInterface
112114
*/
113-
public function download(): StreamInterface
115+
116+
public function download(array $data = []): StreamInterface
114117
{
118+
$data += ['name' => $this->name, 'containerName' => $this->containerName];
119+
115120
/** @var ResponseInterface $response */
116-
$response = $this->executeWithState($this->api->getObject());
121+
$response = $this->execute($this->api->getObject(), $data);
117122
$this->populateHeaders($response);
123+
118124
return $response->getBody();
119125
}
120126

0 commit comments

Comments
 (0)