学说 2 如何加载学说_pager
我尝试使用学说寻呼机,但出现错误:
致命错误:未找到“Doctrine_Pager”类
代码:
$page = 1; $results_per_page = 10;
$pager = new Doctrine_Pager(
$query,
$page,
$results_per_page
);
$results = $pager->execute(array(), Doctrine::HYDRATE_ARRAY);
$num_results = $results->getNumResults();
我通常这样称呼学说 EM:
$this->_doctrine = Zend_Registry::get('doctrineEm');
$query = $this->_doctrine->createQueryBuilder()
我如何加载这个学说寻呼机?
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 = $results->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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我了解,1.2 中的寻呼机已从原则 2 中删除。
但是,您可以向 ORM 添加“理论扩展”,这将为您提供该功能。
https://github.com/beberlei/DoctrineExtensions
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