如何将结果作为来自 Symfony2.1.1 中 PagerFanta 的数组?
$adapter = new \Pagerfanta\Adapter\DoctrineORMAdapter($query);
$pager = new \Pagerfanta\Pagerfanta($adapter);
$pager->setMaxPerPage(45);
$data = $pager->getCurrentPageResults();
结果print_r($data);
ArrayIterator Object
(
[storage:ArrayIterator:private] => Array
(
[0] => Trucking\MainBundle\Entity\Sparcs Object
(
[id:Trucking\MainBundle\Entity\Sparcs:private] => 77940
[container:Trucking\MainBundle\Entity\Sparcs:private] => MEDUUUU
...
...
...
我想得到结果getQuery->getArrayResult();