public function testGetsItemsAtOffsetTen()
 {
     $expected = $this->qb->setFirstResult(10)->setMaxResults(10)->getQuery()->getResult();
     $actual = $this->paginatorAdapter->getItems(10, 10);
     foreach ($expected as $key => $expectedItem) {
         $this->assertEquals($expectedItem, $actual[$key]);
     }
 }
Example #2
0
 /**
  *
  * @return \Zend\Paginator\Paginator
  */
 public function getPaginator()
 {
     if (!$this->paginator) {
         $this->order();
         $adapter = new DoctrineAdapter(new ORMPaginator($this->query));
         $adapter->getPaginator()->setUseOutputWalkers(false);
         $this->paginator = new Paginator($adapter);
         $this->initPaginator();
     }
     return $this->paginator;
 }
Example #3
0
 /**
  * @param Query | QueryBuilder $query
  * @param bool $fetchJoinCollection [OPTIONAL]
  */
 public function __construct($query, $fetchJoinCollection = true)
 {
     parent::__construct(new DoctrinePaginator($query, $fetchJoinCollection));
 }