Skip to content

Instantly share code, notes, and snippets.

@zluiten
Created July 16, 2012 09:16
Show Gist options
  • Save zluiten/d5cd6d0b0ac28e722dd7 to your computer and use it in GitHub Desktop.
Save zluiten/d5cd6d0b0ac28e722dd7 to your computer and use it in GitHub Desktop.
paginator
<?php
$em = $this->getCursusService()->em();
$paginator = new \Zend\Paginator\Paginator(
new \DoctrineORMModule\Paginator\Adapter(
new \Doctrine\ORM\Tools\Pagination\Paginator(
$em->createQuery('SELECT c.id, c.number, SIZE(c.applications) AS applications, SIZE(c.days) AS days FROM Application\\Entity\\Course c')->setHydrationMode(3)
)
)
);
$paginator->setCurrentPageNumber(1);
var_dump($paginator->count());
@benjamingb
Copy link

I have the same problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment