phpzend-framework2resultsetzend-paginator

Zend Paginatinator trigger an error when I call $paginator->getItem()


I got an error in Zend\Paginator\Paginator when I call method getItem()

$select             = $myMapper->getSqlSelect();
$resultSet          = new ResultSet();
$paginatorAdapter   = new DbSelect($select, $myMapper->getAdapter(), $resultSet);
$paginator          = new Paginator($paginatorAdapter);

//echo get_class($paginator); Zend\Paginator\Paginator
$paginator->getItem(1, 1);

Fatal error: Cannot use object of type Zend\Db\ResultSet\ResultSet as array

Everything else works fine when I don't use this method (in view, controllers, etc.)


Solution

  • It was an issue in ZF2. It's solved.

    https://github.com/zendframework/zf2/issues/6812