1 | <?php |
||
22 | class RawPaginatorAdapter implements PaginatorAdapterInterface |
||
23 | { |
||
24 | /** |
||
25 | * @var SearchableInterface the object to search in |
||
26 | */ |
||
27 | private $searchable; |
||
28 | |||
29 | /** |
||
30 | * @var Query the query to search |
||
31 | */ |
||
32 | private $query; |
||
33 | |||
34 | /** |
||
35 | * @var array search options |
||
36 | */ |
||
37 | private $options; |
||
38 | |||
39 | /** |
||
40 | * @var int the number of hits |
||
41 | */ |
||
42 | private $totalHits; |
||
43 | |||
44 | /** |
||
45 | * @var array for the aggregations |
||
46 | */ |
||
47 | private $aggregations; |
||
48 | |||
49 | /** |
||
50 | * @var array for the suggesters |
||
51 | */ |
||
52 | private $suggests; |
||
53 | |||
54 | /** |
||
55 | * @see PaginatorAdapterInterface::__construct |
||
56 | * |
||
57 | * @param SearchableInterface $searchable the object to search in |
||
58 | * @param Query $query the query to search |
||
59 | * @param array $options |
||
60 | */ |
||
61 | 3 | public function __construct(SearchableInterface $searchable, Query $query, array $options = []) |
|
67 | |||
68 | /** |
||
69 | * Returns the paginated results. |
||
70 | * |
||
71 | * @param int $offset |
||
72 | * @param int $itemCountPerPage |
||
73 | * |
||
74 | * @throws \InvalidArgumentException |
||
75 | * |
||
76 | * @return ResultSet |
||
77 | */ |
||
78 | protected function getElasticaResults($offset, $itemCountPerPage) |
||
108 | |||
109 | /** |
||
110 | * {@inheritdoc} |
||
111 | */ |
||
112 | public function getResults($offset, $itemCountPerPage) |
||
116 | |||
117 | /** |
||
118 | * Returns the number of results. |
||
119 | * |
||
120 | * If genuineTotal is provided as true, total hits is returned from the |
||
121 | * hits.total value from the search results instead of just returning |
||
122 | * the requested size. |
||
123 | * |
||
124 | * {@inheritdoc} |
||
125 | */ |
||
126 | public function getTotalHits($genuineTotal = false) |
||
136 | |||
137 | /** |
||
138 | * {@inheritdoc} |
||
139 | */ |
||
140 | public function getAggregations() |
||
148 | |||
149 | /** |
||
150 | * {@inheritdoc} |
||
151 | */ |
||
152 | public function getSuggests() |
||
160 | |||
161 | /** |
||
162 | * Returns the Query. |
||
163 | * |
||
164 | * @return Query the search query |
||
165 | */ |
||
166 | public function getQuery() |
||
170 | } |
||
171 |