| @@ 69-84 (lines=16) @@ | ||
| 66 | /** |
|
| 67 | * {@inheritdoc} |
|
| 68 | */ |
|
| 69 | public function resetMetadata(array $metadata) |
|
| 70 | { |
|
| 71 | $options = [ |
|
| 72 | 'removeMetadata' => [], |
|
| 73 | 'metadata' => $metadata, |
|
| 74 | ]; |
|
| 75 | ||
| 76 | foreach ($this->getMetadata() as $key => $val) { |
|
| 77 | if (!array_key_exists($key, $metadata)) { |
|
| 78 | $options['removeMetadata'][$key] = 'True'; |
|
| 79 | } |
|
| 80 | } |
|
| 81 | ||
| 82 | $response = $this->execute($this->api->postAccount(), $options); |
|
| 83 | return $this->parseMetadata($response); |
|
| 84 | } |
|
| 85 | ||
| 86 | /** |
|
| 87 | * {@inheritdoc} |
|
| @@ 109-125 (lines=17) @@ | ||
| 106 | /** |
|
| 107 | * {@inheritdoc} |
|
| 108 | */ |
|
| 109 | public function resetMetadata(array $metadata) |
|
| 110 | { |
|
| 111 | $options = [ |
|
| 112 | 'name' => $this->name, |
|
| 113 | 'removeMetadata' => [], |
|
| 114 | 'metadata' => $metadata, |
|
| 115 | ]; |
|
| 116 | ||
| 117 | foreach ($this->getMetadata() as $key => $val) { |
|
| 118 | if (!array_key_exists($key, $metadata)) { |
|
| 119 | $options['removeMetadata'][$key] = 'True'; |
|
| 120 | } |
|
| 121 | } |
|
| 122 | ||
| 123 | $response = $this->execute($this->api->postContainer(), $options); |
|
| 124 | return $this->parseMetadata($response); |
|
| 125 | } |
|
| 126 | ||
| 127 | /** |
|
| 128 | * {@inheritdoc} |
|