1 | <?php |
||
15 | class QueryBuilder extends \hiqdev\hiart\AbstractQueryBuilder |
||
16 | { |
||
17 | protected $authHeaders = []; |
||
18 | |||
19 | /** |
||
20 | * This function is for you to provide your authentication. |
||
21 | * @param Query $query |
||
22 | */ |
||
23 | 2 | public function buildAuth(Query $query) |
|
24 | { |
||
25 | 2 | $auth = $this->db->getAuth(); |
|
26 | 2 | if (isset($auth['headerToken'])) { |
|
27 | 2 | $this->authHeaders['Authorization'] = 'token ' . $auth['headerToken']; |
|
28 | } |
||
29 | 2 | if (isset($auth['headerBearer'])) { |
|
30 | $this->authHeaders['Authorization'] = 'Bearer ' . $auth['headerBearer']; |
||
31 | } |
||
32 | 2 | } |
|
33 | |||
34 | 2 | public function buildMethod(Query $query) |
|
49 | |||
50 | public function buildUri(Query $query) |
||
51 | { |
||
52 | return $query->from; |
||
53 | } |
||
54 | |||
55 | 2 | public function buildHeaders(Query $query) |
|
59 | |||
60 | 2 | public function buildProtocolVersion(Query $query) |
|
64 | |||
65 | 2 | public function buildQueryParams(Query $query) |
|
69 | |||
70 | 2 | public function buildFormParams(Query $query) |
|
74 | |||
75 | 2 | public function buildBody(Query $query) |
|
79 | } |
||
80 |