i want to use doctrine with zend_paginator
here some example query :
$allArticleObj = $this->_em->getRepository(\'Articles\'); $qb
The upshot, of course, is that you have to implement the Zend_Paginator_Adapter_Interface, which essentially means implementing the two methods:
count()
getItems($offset, $perPage)
Your adapter would accept the Doctrine query as a constructor argument.
In principle, the getItems() part is actually straightforward. Simply, add the $offset and $perPage restrictions to the query - as you are doing in your sample - and execute the query.
In practice, it's the count() business that tends to be tricky. I'd follow the example of Zend_Paginator_Adapter_DbSelect, replacing the Zend_Db operations with their Doctrine analogues.