ReviewOS

also looking at this

meemalabs/meema-client-php

Tags attachment

#50
Merged glennmichael123 wants to merge tag-attach into main
4 files +187 -9
src/Models/Media.phpmodified+29-3
Changes to src/Models/Media.php
@@ -449,7 +449,7 @@ class Media
449449 *
450450 * @return array
451451 */
452 public function fetchMediaForFolder($id): array
452 protected function fetchMediaForFolder($id): array
453453 {
454454 return $this->client->request('GET', "folders/{$id}/media");
455455 }
@@ -461,7 +461,7 @@ class Media
461461 *
462462 * @return array
463463 */
464 public function fetchMediaForTag($id): array
464 protected function fetchMediaForTag($id): array
465465 {
466466 return $this->client->request('GET', "tags/{$id}/media");
467467 }
@@ -471,7 +471,7 @@ class Media
471471 *
472472 * @return array
473473 */
474 public function fetchForModel()
474 protected function fetchForModel()
475475 {
476476 $data = [];
477477
@@ -489,4 +489,30 @@ class Media
489489
490490 return $data;
491491 }
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 }
492518}