-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Zend\Paginator\Paginator's getItem() trigger an "Fatal error: ..." #6812
Comments
could you try remove $paginatorAdapter = new DbSelect($select, $myMapper->getAdapter()); |
Still same... |
I've tested with Album module from zf2 doc and its work. i've tested with : public function fetchAll($paginated=false)
{
$sql = $this->tableGateway->getSql();
if ($paginated) {
$paginatorAdapter = new DbSelect(
$select,
$this->tableGateway->getAdapter()
);
$paginator = new Paginator($paginatorAdapter);
return $paginator;
}
$resultSet = $this->tableGateway->select();
return $resultSet;
} could you confirm what your code as : $select = $myMapper->getSqlSelect(); ? |
Thanks for replay.. I just cloned a fresh install of ZF2(skeleton app) and pass through tutorial from the web site Everithing works fine, as long as you don't call the function getItem()
the same situation is on my work computer as well on my home laptop |
oops, yes. I think it's actually an issue. I think on if (!is_array($page)) {
$temp = array();
foreach($page as $p) {
$temp[] = $p;
}
$page = $temp;
} |
the actual issue is on Zend\Paginator\Adapter\DbSelect::getItems that need return |
…should return array
@tasmaniski I give a try at PR #6817 for it. |
…should return array
…should return array
…should return array
Fixed in #6817 |
…ect::getItems should return array
…inor CS fixes (spacing)
…onstant use over magic constant: see zendframework/zendframework#5505 for reference
…S: whitespace removal
…DbSelect#getItems()` should return `array` types
…ixed `@group` annotations to comply with `DbSelectTest` ones
…dbselect-getitems-should-return-array' into develop Close zendframework/zendframework#6812 Close zendframework/zendframework#6817
Fatal error: Cannot use object of type Zend\Db\ResultSet\ResultSet as array
I got this error in Zend\Paginator\Paginator when I call method getItem()
Eg:
The text was updated successfully, but these errors were encountered: