ReviewOS

also looking at this

meemalabs/meema-client-php

Bulk folders

#31
Merged glennmichael123 wants to merge bulk-folders into main
3 files +80 -14
src/Models/Favorite.phpmodified+13-2
Changes to src/Models/Favorite.php
@@ -116,10 +116,21 @@ class Favorite
116116 */
117117 public function delete($id)
118118 {
119 if (! is_int($id)) {
120 throw new InvalidFormatException();
119 $ids = is_array($id) ? $id : func_get_args();
120
121 foreach ($ids as $id) {
122 if (! is_int($id)) {
123 throw new InvalidFormatException();
124 }
121125 }
122126
127 if (count($ids) > 1) {
128 return $this->client->request('POST', 'bulk/favorites/delete', ['favorite_ids' => $ids]);
129 }
130
131 // If count is equal to 1 get the first element
132 $id = $ids[0];
133
123134 return $this->client->request('DELETE', "favorites/{$id}");
124135 }
125136}