1 | <?php |
||
25 | class DocumentCursor extends \IteratorIterator |
||
26 | { |
||
27 | /** |
||
28 | * @var Cursor |
||
29 | */ |
||
30 | private $cursor; |
||
31 | |||
32 | /** |
||
33 | * @var string |
||
34 | */ |
||
35 | private $class; |
||
36 | |||
37 | /** |
||
38 | * @var ODMInterface |
||
39 | */ |
||
40 | private $odm; |
||
41 | |||
42 | /** |
||
43 | * @param Cursor $cursor |
||
44 | * @param string $class |
||
45 | * @param ODMInterface $odm |
||
46 | */ |
||
47 | public function __construct(Cursor $cursor, string $class, ODMInterface $odm) |
||
61 | |||
62 | /** |
||
63 | * @return \Spiral\ODM\CompositableInterface |
||
64 | */ |
||
65 | public function current(): CompositableInterface |
||
69 | |||
70 | /** |
||
71 | * @return Cursor |
||
72 | */ |
||
73 | public function getCursor(): Cursor |
||
77 | |||
78 | /** |
||
79 | * @return array |
||
80 | */ |
||
81 | public function toArray(): array |
||
85 | |||
86 | /** |
||
87 | * Fetch all documents. |
||
88 | * |
||
89 | * @return CompositableInterface[] |
||
90 | */ |
||
91 | public function fetchAll(): array |
||
100 | } |