Skip to content

Instantly share code, notes, and snippets.

@rtuin
Last active April 8, 2016 12:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtuin/d87f459ed78ad3abd67191340dc7ca94 to your computer and use it in GitHub Desktop.
Save rtuin/d87f459ed78ad3abd67191340dc7ca94 to your computer and use it in GitHub Desktop.
snc_redis:
clients:
doctrine_meta:
type: phpredis
alias: doctrine_meta
dsn: redis://localhost/2
doctrine:
metadata_cache:
client: doctrine_meta
entity_manager: default # the name of your entity_manager connection
document_manager: default # the name of your document_manager connection
use Doctrine\ORM\Tools\Pagination\Paginator;
$paginator = new Paginator($queryBuilder);
$totalRecords = $paginator->count();
$recordsForPage = $paginator->getIterator();
$queryBuilder
->setFirstResult($start)
->setMaxResults($limit);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment