im trying to use the doctrine pager but its errored:
Fatal error: Class 'Doctrine_Pager' not found
code:
$page = 1; $results_per_page = 10;
$pager = new Doctrine_Pager(
$query,
$page,
$results_per_page
);
$results = $pager->execute(array(), Doctrine::HYDRATE_ARRAY);
$num_results = $res开发者_StackOverflow中文版ults->getNumResults();
i usually call doctrine EM like this:
$this->_doctrine = Zend_Registry::get('doctrineEm');
$query = $this->_doctrine->createQueryBuilder()
how would i load this doctrine pager?
Its my understanding that the pager from 1.2 has been removed from doctrine2.
However, you can add "doctrine extensions" to the ORM which will give you that functionality.
https://github.com/beberlei/DoctrineExtensions
精彩评论