1 | <?php |
||
13 | class RawPaginatorAdapter implements PaginatorAdapterInterface |
||
14 | { |
||
15 | /** |
||
16 | * @var SearchableInterface the object to search in |
||
17 | */ |
||
18 | private $searchable; |
||
19 | |||
20 | /** |
||
21 | * @var Query the query to search |
||
22 | */ |
||
23 | private $query; |
||
24 | |||
25 | /** |
||
26 | * @var array search options |
||
27 | */ |
||
28 | private $options; |
||
29 | |||
30 | /** |
||
31 | * @var integer the number of hits |
||
32 | */ |
||
33 | private $totalHits; |
||
34 | |||
35 | /** |
||
36 | * @var array for the aggregations |
||
37 | */ |
||
38 | private $aggregations; |
||
39 | |||
40 | /** |
||
41 | * @see PaginatorAdapterInterface::__construct |
||
42 | * |
||
43 | * @param SearchableInterface $searchable the object to search in |
||
44 | * @param Query $query the query to search |
||
45 | * @param array $options |
||
46 | */ |
||
47 | public function __construct(SearchableInterface $searchable, Query $query, array $options = array()) |
||
53 | |||
54 | 3 | /** |
|
55 | 3 | * Returns the paginated results. |
|
56 | 3 | * |
|
57 | 3 | * @param integer $offset |
|
58 | * @param integer $itemCountPerPage |
||
59 | * |
||
60 | * @throws \InvalidArgumentException |
||
61 | * |
||
62 | * @return ResultSet |
||
63 | */ |
||
64 | protected function getElasticaResults($offset, $itemCountPerPage) |
||
91 | |||
92 | /** |
||
93 | * {@inheritdoc} |
||
94 | */ |
||
95 | public function getResults($offset, $itemCountPerPage) |
||
99 | |||
100 | /** |
||
101 | * Returns the number of results. |
||
102 | * |
||
103 | * If genuineTotal is provided as true, total hits is returned from the |
||
104 | * hits.total value from the search results instead of just returning |
||
105 | * the requested size. |
||
106 | * |
||
107 | * {@inheritdoc} |
||
108 | */ |
||
109 | public function getTotalHits($genuineTotal = false) |
||
119 | |||
120 | /** |
||
121 | * {@inheritdoc} |
||
122 | */ |
||
123 | public function getAggregations() |
||
131 | |||
132 | /** |
||
133 | * Returns the Query. |
||
134 | * |
||
135 | * @return Query the search query |
||
136 | */ |
||
137 | public function getQuery() |
||
141 | } |
||
142 |