Add findSlots method
This commit is contained in:
1 parent
29c7d1f40c
commit
43d5db56cf
3 files changed
+24
-1
No files matched your search
@@ -48,4 +48,20 @@ class SlotDbClient
|
||||
return $data;
|
||||
}
|
||||
|
||||
public function findSlots(array $where = [], array $what = [], int $limit = 250, int $page = 0): array
|
||||
{
|
||||
$query = [
|
||||
'limit' => $limit,
|
||||
'page' => $page,
|
||||
'get' => join(",",$what),
|
||||
];
|
||||
foreach ($where as $prop=>$cond) {
|
||||
$whereCond = "{$prop}:{$cond}";
|
||||
$query['where[]'] = $whereCond;
|
||||
}
|
||||
$res = $this->get("/slots", $query);
|
||||
$data = json_decode($res->getBody(), true);
|
||||
return $data;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user