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/Folder.phpmodified+28-2
Changes to src/Models/Folder.php
@@ -270,7 +270,7 @@ class Folder
270270 *
271271 * @throws InvalidFormatException
272272 */
273 public function addFolderToMedia($id, $name): array
273 protected function addFolderToMedia($id, $name): array
274274 {
275275 if (! is_int($id)) {
276276 throw new InvalidFormatException();
@@ -289,7 +289,7 @@ class Folder
289289 *
290290 * @throws InvalidFormatException
291291 */
292 public function deleteFolderFromMedia($id, $folderId)
292 protected function deleteFolderFromMedia($id, $folderId)
293293 {
294294 if (! is_int($id) || ! is_int($folderId)) {
295295 throw new InvalidFormatException();
@@ -298,6 +298,32 @@ class Folder
298298 return $this->client->request('DELETE', "media/{$id}/folders/{$folderId}");
299299 }
300300
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
301327 /**
302328 * Initialize media model.
303329 *