Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| PaginatedResult | |
100.00% |
2 / 2 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getIterator | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | namespace Apie\Core\Datalayers\Lists; |
| 3 | |
| 4 | use Apie\Core\Datalayers\Search\QuerySearch; |
| 5 | use Apie\Core\Datalayers\ValueObjects\LazyLoadedListIdentifier; |
| 6 | use Apie\Core\Entities\EntityInterface; |
| 7 | use Apie\Core\Lists\ItemList; |
| 8 | use Iterator; |
| 9 | use IteratorAggregate; |
| 10 | |
| 11 | /** |
| 12 | * @template T of EntityInterface |
| 13 | * @implements IteratorAggregate<int, T> |
| 14 | */ |
| 15 | final class PaginatedResult implements IteratorAggregate |
| 16 | { |
| 17 | /** |
| 18 | * @param LazyLoadedListIdentifier<T> $id |
| 19 | * @param ItemList<T> $list |
| 20 | */ |
| 21 | public function __construct( |
| 22 | public LazyLoadedListIdentifier $id, |
| 23 | public readonly int $totalCount, |
| 24 | public readonly int $filteredCount, |
| 25 | public readonly ItemList $list, |
| 26 | public readonly int $pageNumber, |
| 27 | public readonly int $pageSize, |
| 28 | public readonly QuerySearch $querySearch |
| 29 | ) { |
| 30 | } |
| 31 | |
| 32 | public function getIterator(): Iterator |
| 33 | { |
| 34 | return $this->list->getIterator(); |
| 35 | } |
| 36 | } |