| 1 | <?php |
||
| 8 | class Reader implements QueryableInterface |
||
| 9 | { |
||
| 10 | private $httpClient; |
||
| 11 | private $options; |
||
| 12 | |||
| 13 | 15 | public function __construct(Client $httpClient, Options $options) |
|
| 18 | |||
| 19 | 15 | public function getOptions() |
|
| 23 | |||
| 24 | 12 | public function query($query) |
|
| 25 | { |
||
| 26 | $options = [ |
||
| 27 | 12 | "auth" => [$this->getOptions()->getUsername(), $this->getOptions()->getPassword()], |
|
| 28 | 'query' => [ |
||
| 29 | 12 | "q" => $query, |
|
| 30 | 12 | "db" => $this->getOptions()->getDatabase(), |
|
| 31 | ] |
||
| 32 | ]; |
||
| 33 | |||
| 34 | 12 | return $this->get($options); |
|
| 35 | } |
||
| 36 | |||
| 37 | 12 | private function get(array $httpMessage) |
|
| 42 | |||
| 43 | 15 | protected function getHttpQueryEndpoint() |
|
| 47 | |||
| 48 | 15 | private function getHttpEndpoint($operation) |
|
| 61 | } |
||
| 62 |