-
-
Notifications
You must be signed in to change notification settings - Fork 87
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Roman Konz
committed
Mar 20, 2013
1 parent
5a4ebeb
commit d06eea3
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
``` |