/** * Returns an array of items for a page. * * @param integer $offset Page offset * @param integer $itemCountPerPage Number of items per page * @return array */ public function getItems($offset, $itemCountPerPage) { $data = parent::getItems($offset, $itemCountPerPage); $return = array(); $rowsetConfig = array('rowClass' => $this->_rowClass, 'data' => $data); $rowset = new Zend_Db_Table_Rowset($rowsetConfig); return $rowset; }
/** * @group ZF-4151 */ public function testEmptySet() { $this->_adapter = new Adapter\ArrayAdapter(array()); $actual = $this->_adapter->getItems(0, 10); $this->assertEquals(array(), $actual); }
/** * Verify that the fix for ZF-4151 doesn't create an OBO error */ public function testSetOfOne() { $this->_adapter = new Zend_Paginator_Adapter_Null(1); $actual = $this->_adapter->getItems(0, 10); $this->assertEquals(array_fill(0, 1, null), $actual); }
/** * @group ZF-4151 */ public function testEmptySet() { $this->_adapter = new Zend_Paginator_Adapter_Array(array()); $actual = $this->_adapter->getItems(0, 10); $this->assertEquals(array(), $actual); }
public function testGetsItems() { $actual = $this->_adapter->getItems(0, 10); $this->assertEquals(array_fill(0, 10, null), $actual); }
public function testGetItemsOffsetTen() { $expected = range(11, 20); $actual = $this->_adapter->getItems(10, 10); $this->assertEquals($expected, $actual); }