@@ 12-22 (lines=11) @@ | ||
9 | abstract class SingleRequestApi implements CrudsApiInterface |
|
10 | { |
|
11 | /** {@inheritdoc} */ |
|
12 | public function count(array $criteria = []) |
|
13 | { |
|
14 | $request = $this->createCountRequest($criteria); |
|
15 | $response = $this->getClient()->invoke($request)->getResponse($request); |
|
16 | ||
17 | if (!$response->isSuccessful()) { |
|
18 | throw ApiCallException::callFailed($response); |
|
19 | } |
|
20 | ||
21 | return (int)$response->getBody(); |
|
22 | } |
|
23 | ||
24 | /** {@inheritdoc} */ |
|
25 | public function find(array $identifier) |
|
@@ 25-35 (lines=11) @@ | ||
22 | } |
|
23 | ||
24 | /** {@inheritdoc} */ |
|
25 | public function find(array $identifier) |
|
26 | { |
|
27 | $request = $this->createFindRequest($identifier); |
|
28 | $response = $this->getClient()->invoke([$request])->getResponse($request); |
|
29 | ||
30 | if (!$response->isSuccessful()) { |
|
31 | throw ApiCallException::callFailed($response); |
|
32 | } |
|
33 | ||
34 | return $response->getBody(); |
|
35 | } |
|
36 | ||
37 | /** {@inheritdoc} */ |
|
38 | public function search(array $criteria = [], array $orderBy = null, $limit = null, $offset = null) |