| Total Complexity | 3 |
| Total Lines | 37 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 16 | class DoctrineMongoAdapter implements AdapterInterface |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * @var QueryBuilder |
||
| 20 | */ |
||
| 21 | private QueryBuilder $builder; |
||
| 22 | |||
| 23 | public function __construct(QueryBuilder $builder) |
||
| 26 | } |
||
| 27 | |||
| 28 | /** |
||
| 29 | * @param int $offset |
||
| 30 | * @param int $itemCountPerPage |
||
| 31 | * @return array |
||
| 32 | * @throws \Doctrine\ODM\MongoDB\MongoDBException |
||
| 33 | */ |
||
| 34 | public function getItems($offset, $itemCountPerPage) |
||
| 35 | { |
||
| 36 | $builder = $this->builder; |
||
| 37 | $builder->skip($offset); |
||
| 38 | $builder->limit($itemCountPerPage); |
||
| 39 | $builder->getQuery()->getIterator()->toArray(); |
||
| 40 | |||
| 41 | return $builder->getQuery()->getIterator()->toArray(); |
||
| 42 | } |
||
| 43 | |||
| 44 | /** |
||
| 45 | * @return int |
||
| 46 | * @throws \Doctrine\ODM\MongoDB\MongoDBException |
||
| 47 | */ |
||
| 48 | public function count() |
||
| 53 | } |
||
| 54 | } |