1 | <?php |
||
32 | class Result implements \Iterator, \Countable |
||
33 | { |
||
34 | /** |
||
35 | * @var \MongoCursor |
||
36 | */ |
||
37 | protected $myResultCursor = null; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | private $collection; |
||
43 | /** |
||
44 | * @var ContainerInterface |
||
45 | */ |
||
46 | private $container; |
||
47 | /** |
||
48 | * @var ClassMapInterface |
||
49 | */ |
||
50 | private $classMapInterface; |
||
51 | |||
52 | /** |
||
53 | * @param ContainerInterface $container |
||
54 | * @param ClassMapInterface $classMapInterface |
||
55 | */ |
||
56 | public function __construct( |
||
63 | |||
64 | /** |
||
65 | * @param \MongoCursor $cursor |
||
66 | */ |
||
67 | public function setCursor($cursor) |
||
71 | |||
72 | /** |
||
73 | * @param string $collection |
||
74 | */ |
||
75 | public function setCollection($collection) |
||
79 | |||
80 | /** |
||
81 | * Iterator::rewind |
||
82 | */ |
||
83 | public function rewind() |
||
87 | |||
88 | /** |
||
89 | * Iterator::valid |
||
90 | * |
||
91 | * @return bool |
||
92 | */ |
||
93 | public function valid() |
||
97 | |||
98 | /** |
||
99 | * Iterator::key |
||
100 | * |
||
101 | * @return string key |
||
102 | */ |
||
103 | public function key() |
||
107 | |||
108 | /** |
||
109 | * Iterator::next |
||
110 | */ |
||
111 | public function next() |
||
115 | |||
116 | /** |
||
117 | * Iterator::current |
||
118 | * return current specific object |
||
119 | * |
||
120 | * @return MongoObject |
||
121 | * @throws Exception |
||
122 | * @throws \MongoException |
||
123 | */ |
||
124 | public function current() |
||
140 | |||
141 | /** |
||
142 | * count method on the cursor, allows to get result count |
||
143 | * |
||
144 | * @param bool $foundOnly |
||
145 | * @return int |
||
146 | */ |
||
147 | public function count($foundOnly = false) |
||
151 | |||
152 | /** |
||
153 | * @return Result a sort on the cursor |
||
154 | * @param array $sortoptions |
||
155 | * @returns Result |
||
156 | * @throws \MongoCursorException |
||
157 | */ |
||
158 | public function sort(array $sortoptions) |
||
164 | |||
165 | /** |
||
166 | * @param array $hintoptions |
||
167 | * @return Result |
||
168 | * @throws \MongoCursorException |
||
169 | */ |
||
170 | public function hint(array $hintoptions) |
||
176 | |||
177 | /** |
||
178 | * @param $amount |
||
179 | * @return Result |
||
180 | * |
||
181 | * @throws \MongoCursorException |
||
182 | */ |
||
183 | public function limit($amount) |
||
189 | |||
190 | /** |
||
191 | * Skip the first $num results |
||
192 | * |
||
193 | * @param integer $num |
||
194 | * @return Result |
||
195 | * @throws \MongoCursorException |
||
196 | */ |
||
197 | public function skip($num) |
||
203 | } |
||
204 |