1 | <?php |
||
17 | class ElasticaAdapter implements AdapterInterface |
||
18 | { |
||
19 | /** |
||
20 | * @var Query |
||
21 | */ |
||
22 | private $query; |
||
23 | |||
24 | /** |
||
25 | * @var \Elastica\ResultSet |
||
26 | */ |
||
27 | private $resultSet; |
||
28 | |||
29 | /** |
||
30 | * @var SearchableInterface |
||
31 | */ |
||
32 | private $searchable; |
||
33 | |||
34 | /** |
||
35 | * @var int|null |
||
36 | */ |
||
37 | private $maxResults; |
||
38 | |||
39 | 4 | public function __construct(SearchableInterface $searchable, Query $query, $maxResults = null) |
|
45 | |||
46 | /** |
||
47 | * Returns the number of results. |
||
48 | * |
||
49 | * @return integer The number of results. |
||
50 | */ |
||
51 | 2 | public function getNbResults() |
|
65 | |||
66 | /** |
||
67 | * Returns the Elastica ResultSet. Will return null if getSlice has not yet been |
||
68 | * called. |
||
69 | * |
||
70 | * @return \Elastica\ResultSet|null |
||
71 | */ |
||
72 | 2 | public function getResultSet() |
|
76 | |||
77 | /** |
||
78 | * Returns an slice of the results. |
||
79 | * |
||
80 | * @param integer $offset The offset. |
||
81 | * @param integer $length The length. |
||
82 | * |
||
83 | * @return array|\Traversable The slice. |
||
84 | */ |
||
85 | 2 | public function getSlice($offset, $length) |
|
92 | } |
||
93 |