also looking at this
Tags attachment
#50
4 files
+187
-9
| @@ -270,7 +270,7 @@ class Folder | ||
| 270 | 270 | * |
| 271 | 271 | * @throws InvalidFormatException |
| 272 | 272 | */ |
| 273 | public function addFolderToMedia($id, $name): array | |
| 273 | protected function addFolderToMedia($id, $name): array | |
| 274 | 274 | { |
| 275 | 275 | if (! is_int($id)) { |
| 276 | 276 | throw new InvalidFormatException(); |
| @@ -289,7 +289,7 @@ class Folder | ||
| 289 | 289 | * |
| 290 | 290 | * @throws InvalidFormatException |
| 291 | 291 | */ |
| 292 | public function deleteFolderFromMedia($id, $folderId) | |
| 292 | protected function deleteFolderFromMedia($id, $folderId) | |
| 293 | 293 | { |
| 294 | 294 | if (! is_int($id) || ! is_int($folderId)) { |
| 295 | 295 | throw new InvalidFormatException(); |
| @@ -298,6 +298,32 @@ class Folder | ||
| 298 | 298 | return $this->client->request('DELETE', "media/{$id}/folders/{$folderId}"); |
| 299 | 299 | } |
| 300 | 300 | |
| 301 | /** | |
| 302 | * Associate tag to a folder. | |
| 303 | * | |
| 304 | * @param int $id | |
| 305 | * @param array $tag | |
| 306 | * | |
| 307 | * @return array | |
| 308 | */ | |
| 309 | public function associateTag($id, $tag) | |
| 310 | { | |
| 311 | return $this->client->request('POST', "folders/{$id}/tag/attach", $tag); | |
| 312 | } | |
| 313 | ||
| 314 | /** | |
| 315 | * Disassociate tag from a folder. | |
| 316 | * | |
| 317 | * @param int $id | |
| 318 | * @param array $tag | |
| 319 | * | |
| 320 | * @return array | |
| 321 | */ | |
| 322 | public function disassociateTag($id, $tag) | |
| 323 | { | |
| 324 | return $this->client->request('POST', "folders/{$id}/tag/detach", $tag); | |
| 325 | } | |
| 326 | ||
| 301 | 327 | /** |
| 302 | 328 | * Initialize media model. |
| 303 | 329 | * |