protected function traversePage($query, $marker, $params, BasePager $pager, \Closure $callable = null) { $list = $this->getDatabaseSession()->traverse($query . ' ' . $pager->buildSQL(), $callable, $marker, $params); $nextPage = null; $prevPage = $pager->getPage() <= 1 ? null : $pager->getPage() - 1; if (count($list) > $pager->getLimit()) { array_pop($list); $nextPage = $pager->getPage() + 1; } return $list ? new PagingResult($list, $prevPage, $nextPage, $pager->getLimit(), $pager->getOrder(), $pager->getDirection()) : null; }
public function testBuildSQL() { $this->assertSame('ORDER BY col1Name DESC LIMIT 11 OFFSET 10', $this->target->buildSQL()); }