Skip to content

Commit 8a70bdc

Browse files
committed
Added update method to ObjectStorage
1 parent 3374e2b commit 8a70bdc

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

src/ObjectStore/v1/Models/StorageObject.php

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,24 @@ public function copy(array $options)
173173
}
174174

175175
/**
176-
* {@inheritdoc}
176+
* Update object system metadata and custom metadata.
177+
*
178+
* @param array $options {@see \OpenStack\ObjectStore\v1\Api::postObject}
179+
*
180+
*/
181+
public function update(array $options)
182+
{
183+
$options += ['name' => $this->name, 'containerName' => $this->containerName];
184+
$options['metadata'] = array_merge($options['metadata'] ?? [] , $this->getMetadata());
185+
186+
$response = $this->execute($this->api->postObject(), $options);
187+
$this->metadata = $this->parseMetadata($response);
188+
}
189+
190+
/**
191+
* Update object only custom metadata.
192+
*
193+
* @param array $metadata
177194
*/
178195
public function mergeMetadata(array $metadata)
179196
{

0 commit comments

Comments
 (0)