1 | <?php |
||
7 | class Request |
||
8 | { |
||
9 | /** |
||
10 | * Contains Economic_Client instance |
||
11 | * |
||
12 | * @access protected |
||
13 | */ |
||
14 | protected $client; |
||
15 | |||
16 | /** |
||
17 | * __construct function. |
||
18 | * |
||
19 | * Instantiates the object |
||
20 | * |
||
21 | * @access public |
||
22 | */ |
||
23 | 4 | public function __construct($client) |
|
27 | |||
28 | /** |
||
29 | * GET function. |
||
30 | * |
||
31 | * Performs an API GET request |
||
32 | * |
||
33 | * @access public |
||
34 | * @param string $path |
||
35 | * @param array $query |
||
36 | * @return Response |
||
37 | */ |
||
38 | 4 | public function get($path, $query = array()) |
|
55 | |||
56 | /** |
||
57 | * POST function. |
||
58 | * |
||
59 | * Performs an API POST request |
||
60 | * |
||
61 | * @access public |
||
62 | * @return Response |
||
63 | */ |
||
64 | public function post($path, $form = array()) |
||
72 | |||
73 | /** |
||
74 | * PUT function. |
||
75 | * |
||
76 | * Performs an API PUT request |
||
77 | * |
||
78 | * @access public |
||
79 | * @return Response |
||
80 | */ |
||
81 | public function put($path, $form = array()) |
||
89 | |||
90 | /** |
||
91 | * PATCH function. |
||
92 | * |
||
93 | * Performs an API PATCH request |
||
94 | * |
||
95 | * @access public |
||
96 | * @return Response |
||
97 | */ |
||
98 | public function patch($path, $form = array()) |
||
106 | |||
107 | /** |
||
108 | * DELETE function. |
||
109 | * |
||
110 | * Performs an API DELETE request |
||
111 | * |
||
112 | * @access public |
||
113 | * @return Response |
||
114 | */ |
||
115 | public function delete($path, $form = array()) |
||
123 | |||
124 | /** |
||
125 | * setUrl function. |
||
126 | * |
||
127 | * Takes an API request string and appends it to the API url |
||
128 | * |
||
129 | * @access protected |
||
130 | * @return void |
||
131 | */ |
||
132 | 4 | protected function setUrl($params) |
|
136 | |||
137 | |||
138 | /** |
||
139 | * @param $request_type |
||
140 | * @param array $form |
||
141 | * @return Response |
||
142 | * @throws Exception |
||
143 | */ |
||
144 | 4 | protected function execute($request_type, $form = array()) |
|
181 | } |
||
182 |