| @@ 145-153 (lines=9) @@ | ||
| 142 | * |
|
| 143 | * @throws PluginApiException |
|
| 144 | */ |
|
| 145 | public function getPurchased() |
|
| 146 | { |
|
| 147 | $url = $this->getApiUrl().'/plugins/purchased'; |
|
| 148 | ||
| 149 | $payload = $this->requestApi($url); |
|
| 150 | $plugins = json_decode($payload, true); |
|
| 151 | ||
| 152 | return $this->buildPlugins($plugins); |
|
| 153 | } |
|
| 154 | ||
| 155 | /** |
|
| 156 | * Get recommended plugins list |
|
| @@ 162-170 (lines=9) @@ | ||
| 159 | * |
|
| 160 | * @throws PluginApiException |
|
| 161 | */ |
|
| 162 | public function getRecommended() |
|
| 163 | { |
|
| 164 | $url = $this->getApiUrl().'/plugins/recommended'; |
|
| 165 | ||
| 166 | $payload = $this->requestApi($url); |
|
| 167 | $plugins = json_decode($payload, true); |
|
| 168 | ||
| 169 | return $this->buildPlugins($plugins); |
|
| 170 | } |
|
| 171 | ||
| 172 | private function buildPlugins(&$plugins) |
|
| 173 | { |
|
| @@ 223-231 (lines=9) @@ | ||
| 220 | * |
|
| 221 | * @throws PluginApiException |
|
| 222 | */ |
|
| 223 | public function getPlugin($id) |
|
| 224 | { |
|
| 225 | $url = $this->getApiUrl().'/plugin/'.$id; |
|
| 226 | ||
| 227 | $payload = $this->requestApi($url); |
|
| 228 | $json = json_decode($payload, true); |
|
| 229 | ||
| 230 | return $this->buildInfo($json); |
|
| 231 | } |
|
| 232 | ||
| 233 | public function pluginInstalled(Plugin $Plugin) |
|
| 234 | { |
|