also looking at this
Tags attachment
#50
4 files
+187
-9
| @@ -449,7 +449,7 @@ class Media | ||
| 449 | 449 | * |
| 450 | 450 | * @return array |
| 451 | 451 | */ |
| 452 | public function fetchMediaForFolder($id): array | |
| 452 | protected function fetchMediaForFolder($id): array | |
| 453 | 453 | { |
| 454 | 454 | return $this->client->request('GET', "folders/{$id}/media"); |
| 455 | 455 | } |
| @@ -461,7 +461,7 @@ class Media | ||
| 461 | 461 | * |
| 462 | 462 | * @return array |
| 463 | 463 | */ |
| 464 | public function fetchMediaForTag($id): array | |
| 464 | protected function fetchMediaForTag($id): array | |
| 465 | 465 | { |
| 466 | 466 | return $this->client->request('GET', "tags/{$id}/media"); |
| 467 | 467 | } |
| @@ -471,7 +471,7 @@ class Media | ||
| 471 | 471 | * |
| 472 | 472 | * @return array |
| 473 | 473 | */ |
| 474 | public function fetchForModel() | |
| 474 | protected function fetchForModel() | |
| 475 | 475 | { |
| 476 | 476 | $data = []; |
| 477 | 477 | |
| @@ -489,4 +489,30 @@ class Media | ||
| 489 | 489 | |
| 490 | 490 | return $data; |
| 491 | 491 | } |
| 492 | ||
| 493 | /** | |
| 494 | * Associate tag to a media. | |
| 495 | * | |
| 496 | * @param int $id | |
| 497 | * @param array $tag | |
| 498 | * | |
| 499 | * @return array | |
| 500 | */ | |
| 501 | public function associateTag($id, $tag) | |
| 502 | { | |
| 503 | return $this->client->request('POST', "media/{$id}/tag/attach", $tag); | |
| 504 | } | |
| 505 | ||
| 506 | /** | |
| 507 | * Disassociate tag from a media. | |
| 508 | * | |
| 509 | * @param int $id | |
| 510 | * @param array $tag | |
| 511 | * | |
| 512 | * @return array | |
| 513 | */ | |
| 514 | public function disassociateTag($id, $tag) | |
| 515 | { | |
| 516 | return $this->client->request('POST', "media/{$id}/tag/detach", $tag); | |
| 517 | } | |
| 492 | 518 | } |