1 | <?php |
||
25 | class ResourceAdapter implements AdapterInterface |
||
26 | { |
||
27 | /** |
||
28 | * HTTP Client. |
||
29 | * |
||
30 | * @var ApiClientInterface |
||
31 | */ |
||
32 | protected $client; |
||
33 | |||
34 | /** |
||
35 | * API Request object. |
||
36 | * |
||
37 | * @var RequestInterface |
||
38 | */ |
||
39 | protected $request; |
||
40 | |||
41 | /** |
||
42 | * Instantiate object. |
||
43 | * |
||
44 | * @param ApiClientInterface $client HTTP Client |
||
45 | * @param RequestInterface $request API Request object |
||
46 | */ |
||
47 | public function __construct(ApiClientInterface $client, RequestInterface $request) |
||
52 | |||
53 | /** |
||
54 | * Make HTTP call. |
||
55 | * |
||
56 | * @return \Superdesk\ContentApiSdk\Api\Response API Response object |
||
57 | */ |
||
58 | private function doCall(RequestInterface $request) |
||
62 | |||
63 | /** |
||
64 | * Returns the number of results. |
||
65 | * |
||
66 | * @return integer The number of results. |
||
67 | */ |
||
68 | public function getNbResults() |
||
74 | |||
75 | /** |
||
76 | * Returns an slice of the results. |
||
77 | * |
||
78 | * @param integer $offset The offset. |
||
79 | * @param integer $length The length. |
||
80 | * |
||
81 | * @return array|stdClass|\Traversable The slice. |
||
82 | * |
||
83 | * @throws InvalidDataException |
||
84 | */ |
||
85 | public function getSlice($offset, $length) |
||
94 | } |
||
95 |