| 1 | <?php |
||
| 12 | class Query implements QueryInterface |
||
| 13 | { |
||
| 14 | /** |
||
| 15 | * Array of query attributes |
||
| 16 | * @var array |
||
| 17 | */ |
||
| 18 | private $_attributes = []; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Endpoint of query |
||
| 22 | * @var string |
||
| 23 | */ |
||
| 24 | private $_endpoint; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * Query constructor. |
||
| 28 | * |
||
| 29 | * @param string $endpoint Path of endpoint |
||
| 30 | */ |
||
| 31 | 5 | public function __construct(string $endpoint) |
|
| 35 | |||
| 36 | /** |
||
| 37 | * Append to array yet another attribute of query |
||
| 38 | * |
||
| 39 | * @param string $word |
||
| 40 | * @return QueryInterface |
||
| 41 | */ |
||
| 42 | 2 | public function add(string $word): QueryInterface |
|
| 47 | |||
| 48 | /** |
||
| 49 | * Get attributes array of current query |
||
| 50 | * |
||
| 51 | * @return array |
||
| 52 | */ |
||
| 53 | 3 | public function getAttributes(): array |
|
| 57 | |||
| 58 | /** |
||
| 59 | * Get endpoint of current query |
||
| 60 | * |
||
| 61 | * @return string |
||
| 62 | */ |
||
| 63 | 2 | public function getEndpoint(): string |
|
| 67 | |||
| 68 | /** |
||
| 69 | * Build body of query |
||
| 70 | * |
||
| 71 | * @return array |
||
| 72 | */ |
||
| 73 | 1 | public function getQuery(): array |
|
| 81 | } |
||
| 82 |