1 | <?php |
||
14 | class OffsetResult |
||
15 | { |
||
16 | /** |
||
17 | * @var int |
||
18 | */ |
||
19 | protected $totalCount = 0; |
||
20 | |||
21 | /** |
||
22 | * @var \Generator |
||
23 | */ |
||
24 | protected $generator; |
||
25 | |||
26 | /** |
||
27 | * OffsetResult constructor. |
||
28 | * |
||
29 | * @param \Generator $sourceResultGenerator |
||
30 | * |
||
31 | * @throws \UnexpectedValueException |
||
32 | */ |
||
33 | public function __construct(\Generator $sourceResultGenerator) |
||
40 | |||
41 | /** |
||
42 | * @throws \UnexpectedValueException |
||
43 | * |
||
44 | * @return mixed|null |
||
45 | */ |
||
46 | public function fetch() |
||
55 | |||
56 | /** |
||
57 | * @throws \UnexpectedValueException |
||
58 | * |
||
59 | * @return array |
||
60 | */ |
||
61 | public function fetchAll() |
||
70 | |||
71 | /** |
||
72 | * @return int |
||
73 | */ |
||
74 | public function getTotalCount() |
||
78 | |||
79 | /** |
||
80 | * @param \Generator $generator |
||
81 | * |
||
82 | * @throws \UnexpectedValueException |
||
83 | * |
||
84 | * @return \Generator |
||
85 | */ |
||
86 | protected function execute(\Generator $generator) |
||
106 | } |
||
107 |