also looking at this
WIP: Upload Endpoint
#38
6 files
+172
-94
| @@ -46,21 +46,21 @@ class Tag | ||
| 46 | 46 | /** |
| 47 | 47 | * Get specific tags. |
| 48 | 48 | * |
| 49 | * @param int $id | |
| 49 | * @param array $ids | |
| 50 | 50 | * |
| 51 | 51 | * @return array |
| 52 | 52 | */ |
| 53 | public function get($id = null): array | |
| 53 | public function get($ids = null): array | |
| 54 | 54 | { |
| 55 | 55 | if ($this->model) { |
| 56 | 56 | return $this->fetchForModel(); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | if (! $id) { | |
| 59 | if (! $ids) { | |
| 60 | 60 | return $this->all(); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | $ids = is_array($id) ? $id : func_get_args(); | |
| 63 | $ids = is_array($ids) ? $ids : func_get_args(); | |
| 64 | 64 | |
| 65 | 65 | foreach ($ids as $id) { |
| 66 | 66 | if (! is_int($id)) { |
| @@ -90,10 +90,10 @@ class Tag | ||
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | /** |
| 93 | * Update folder. | |
| 93 | * Update a tag color. | |
| 94 | 94 | * |
| 95 | * @param string $name | |
| 96 | 95 | * @param int $id |
| 96 | * @param string $color | |
| 97 | 97 | * |
| 98 | 98 | * @return array |
| 99 | 99 | */ |
| @@ -106,22 +106,21 @@ class Tag | ||
| 106 | 106 | $data = [ |
| 107 | 107 | 'color' => $color, |
| 108 | 108 | 'tag_id' => $id, |
| 109 | 'team_id' => 1, | |
| 110 | 109 | ]; |
| 111 | 110 | |
| 112 | 111 | return $this->client->request('PATCH', 'tags/color', $data); |
| 113 | 112 | } |
| 114 | 113 | |
| 115 | 114 | /** |
| 116 | * Delete a folder. | |
| 115 | * Delete tags. | |
| 117 | 116 | * |
| 118 | * @param int $id | |
| 117 | * @param array $ids | |
| 119 | 118 | * |
| 120 | 119 | * @return Response |
| 121 | 120 | */ |
| 122 | public function delete($id) | |
| 121 | public function delete($ids) | |
| 123 | 122 | { |
| 124 | $ids = is_array($id) ? $id : func_get_args(); | |
| 123 | $ids = is_array($ids) ? $ids : func_get_args(); | |
| 125 | 124 | |
| 126 | 125 | foreach ($ids as $id) { |
| 127 | 126 | if (! is_int($id)) { |
| @@ -142,6 +141,8 @@ class Tag | ||
| 142 | 141 | /** |
| 143 | 142 | * Initialize the media model. |
| 144 | 143 | * |
| 144 | * @param int $id | |
| 145 | * | |
| 145 | 146 | * @return Meema\MeemaApi\Models\Media |
| 146 | 147 | */ |
| 147 | 148 | public function media($id = null): Media |
| @@ -154,6 +155,8 @@ class Tag | ||
| 154 | 155 | /** |
| 155 | 156 | * Initialize the folder model. |
| 156 | 157 | * |
| 158 | * @param int $id | |
| 159 | * | |
| 157 | 160 | * @return Meema\MeemaApi\Models\Folder |
| 158 | 161 | */ |
| 159 | 162 | public function folders($id = null): Folder |