1 | <?php |
||
17 | class ElasticSearchCursor implements FinderCursorInterface |
||
18 | { |
||
19 | |||
20 | /** |
||
21 | * Whether query was sent to search server |
||
22 | * @var bool |
||
23 | */ |
||
24 | private $isExecuted = false; |
||
25 | |||
26 | /** |
||
27 | * |
||
28 | * @var QueryBuilder |
||
29 | */ |
||
30 | private $qb = null; |
||
31 | |||
32 | /** |
||
33 | * |
||
34 | * @var array |
||
35 | */ |
||
36 | private $data = []; |
||
37 | |||
38 | 30 | public function __construct(QueryBuilder $qb) |
|
47 | |||
48 | 19 | public function limit($num) |
|
53 | |||
54 | 14 | public function skip($num) |
|
59 | |||
60 | 20 | public function sort(array $fields) |
|
65 | |||
66 | public function fields(array $fields) |
||
71 | |||
72 | // <editor-fold defaultstate="collapsed" desc="Countable impl"> |
||
73 | |||
74 | /** |
||
75 | * |
||
76 | * @return int |
||
77 | */ |
||
78 | 6 | public function count() |
|
83 | |||
84 | // </editor-fold> |
||
85 | // <editor-fold defaultstate="collapsed" desc="Iterator impl"> |
||
86 | 25 | public function current() |
|
91 | |||
92 | public function key() |
||
97 | |||
98 | 20 | public function next() |
|
103 | |||
104 | 20 | public function rewind() |
|
109 | |||
110 | 20 | public function valid() |
|
116 | |||
117 | 30 | private function execute() |
|
142 | |||
143 | // </editor-fold> |
||
144 | } |
||
145 |