Skip to content

Commit

Permalink
added docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Roman Konz committed Mar 20, 2013
1 parent 5a4ebeb commit d06eea3
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions doc/Paginator.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Pagination Adapter
==================

#### Example:

```php
// note: the cursor is not executed until you receive items from the pagination adapter
$cursor = $documentManager->getRepository('Users')->findAll();
$paginationAdapter = DoctrineMongoODMModule\Paginator\Adapter\DoctrinePaginator($cursor);

// Get first 5 users. Only the first five users are fetched from MongoDB.
$users = $paginationAdapter->getItems(0, 5);

// If you call it the second time, a new query is executed on MongoDB.
$users2 = $paginationAdapter->getItems(5, 5);
```

0 comments on commit d06eea3

Please sign in to comment.