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