开发者

doctrine 2 how to load doctrine_pager

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜