Skip to content

Commit 2b8dc18

Browse files
author
Artem Shteltser
committed
Fixed queries
1 parent c3f24d0 commit 2b8dc18

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/PowerLink.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
class PowerLink
1010
{
1111
/** @var string Package version */
12-
const VERSION = '1.0.0';
12+
const VERSION = '1.0.1';
1313

1414
/** @var string The API access token */
1515
protected static $token = null;
@@ -107,7 +107,7 @@ private function resolveResult(ResponseInterface $response)
107107
*
108108
* @throws PowerLinkException When respose returned with error
109109
*/
110-
private function request(string $method, string $path, array $params)
110+
private function request(string $method, string $path, array $params = array())
111111
{
112112
try {
113113
$response = $this->client->request($method, $path, [
@@ -134,6 +134,7 @@ private function request(string $method, string $path, array $params)
134134
public function query(Query $query_object)
135135
{
136136
$params = $query_object->getParams();
137+
print_r($params);
137138
return $this->request("POST", "query", $params);
138139
}
139140

@@ -157,7 +158,7 @@ public function create(string $object_type, array $params)
157158
*
158159
* @return object
159160
*/
160-
public function update(string $object_type, int $id, array $params)
161+
public function update(string $object_type, string $id, array $params)
161162
{
162163
return $this->request("PUT", "record/$object_type/$id", $params);
163164
}
@@ -170,8 +171,8 @@ public function update(string $object_type, int $id, array $params)
170171
*
171172
* @return object
172173
*/
173-
public function delete(string $object_type, int $id, array $params)
174+
public function delete(string $object_type, string $id)
174175
{
175-
return $this->request("DELETE", "record/$object_type/$id", $params);
176+
return $this->request("DELETE", "record/$object_type/$id");
176177
}
177178
}

0 commit comments

Comments
 (0)