public function __construct(Sabel_View_Pager $pager, $window = null) { $this->pager = clone $pager; $this->current = $pager->getPageNumber(); $this->lastPage = $pager->getTotalPageNumber(); if (is_numeric($window)) { $this->window = $window; } }
public function testInitializedPagerUse() { $pager = new Sabel_View_Pager(200, 20); $pager->setPageNumber(4.3); $this->assertEquals(200, $pager->getNumberOfItem()); $this->assertEquals(20, $pager->getLimit()); $this->assertEquals(4, $pager->getPageNumber()); $this->assertEquals(10, $pager->getTotalPageNumber()); $this->assertEquals(60, $pager->getSqlOffset()); }