| 1 | <?php declare(strict_types=1); |
||
| 12 | abstract class Service |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * List of supported query parameters. |
||
| 16 | * @var array |
||
| 17 | */ |
||
| 18 | protected $supportedParameters = []; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Perform a query. |
||
| 22 | * |
||
| 23 | * @return Result |
||
| 24 | * @throws Error |
||
| 25 | */ |
||
| 26 | abstract public function query(array $request, string $path=''): Result; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Enable support of a query parameter. |
||
| 30 | * @param string $name |
||
| 31 | */ |
||
| 32 | public function supportParameter($name) |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Get a list of supported query parameters. |
||
| 43 | * @return array |
||
| 44 | */ |
||
| 45 | public function getSupportedParameters() |
||
| 49 | |||
| 50 | /** |
||
| 51 | * Get a list of query parameters as URI template. |
||
| 52 | * |
||
| 53 | * @return string |
||
| 54 | */ |
||
| 55 | public function uriTemplate($template='') |
||
| 62 | } |
||
| 63 |