1 | <?php |
||
10 | class Request |
||
11 | { |
||
12 | /** |
||
13 | * Contains Economic_Client instance. |
||
14 | */ |
||
15 | protected $client; |
||
16 | |||
17 | /** |
||
18 | * __construct function. |
||
19 | * |
||
20 | 4 | * Instantiates the object |
|
21 | * |
||
22 | 4 | * @param Client $client |
|
23 | 4 | */ |
|
24 | public function __construct(Client $client) |
||
28 | |||
29 | /** |
||
30 | * GET function. |
||
31 | * |
||
32 | * Performs an API GET request |
||
33 | * |
||
34 | * @param string $path |
||
35 | 4 | * @param array $query |
|
36 | * |
||
37 | * @throws Exception |
||
38 | 4 | * |
|
39 | * @return Response |
||
40 | */ |
||
41 | public function get($path, $query = []) |
||
55 | |||
56 | /** |
||
57 | * POST function. |
||
58 | * |
||
59 | * Performs an API POST request |
||
60 | * |
||
61 | * @param string $path |
||
62 | * @param array $form |
||
63 | * |
||
64 | * @throws Exception |
||
65 | * |
||
66 | * @return Response |
||
67 | */ |
||
68 | public function post($path, $form = []) |
||
73 | |||
74 | /** |
||
75 | * PUT function. |
||
76 | * |
||
77 | * Performs an API PUT request |
||
78 | * |
||
79 | * @param string $path |
||
80 | * @param array $form |
||
81 | * |
||
82 | * @throws Exception |
||
83 | * |
||
84 | * @return Response |
||
85 | */ |
||
86 | public function put($path, $form = []) |
||
91 | |||
92 | /** |
||
93 | * PATCH function. |
||
94 | * |
||
95 | * Performs an API PATCH request |
||
96 | * |
||
97 | * @param string $path |
||
98 | * @param array $form |
||
99 | * |
||
100 | * @throws Exception |
||
101 | * |
||
102 | * @return Response |
||
103 | */ |
||
104 | public function patch($path, $form = []) |
||
109 | |||
110 | /** |
||
111 | * DELETE function. |
||
112 | * |
||
113 | * Performs an API DELETE request |
||
114 | * |
||
115 | * @param string $path |
||
116 | * @param array $form |
||
117 | * |
||
118 | * @throws Exception |
||
119 | * |
||
120 | * @return Response |
||
121 | */ |
||
122 | public function delete($path, $form = []) |
||
127 | 4 | ||
128 | /** |
||
129 | * @param string $request_type |
||
130 | * @param array $form |
||
131 | * |
||
132 | * @param string $path |
||
133 | * @return Response |
||
134 | * @throws Exception |
||
135 | */ |
||
136 | protected function execute($request_type, $path, $form = []) |
||
191 | } |
||
192 |