Permalink
Browse files

added docs

  • Loading branch information...
1 parent 5a4ebeb commit d06eea31c3b7f2cbc2608bcd16ed9ab90f53e021 @romankonz romankonz committed Mar 20, 2013
Showing with 16 additions and 0 deletions.
  1. +16 −0 doc/Paginator.md
View
@@ -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.