开发者

doctrine 2 how to load doctrine_pager

开发者 https://www.devze.com 2023-03-22 05:18 出处:网络
im trying to use the doctrine pager but its errored: Fatal error: Class \'Doctrine_Pager\' not found code:

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

精彩评论

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