Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/Adapter/DbSelect.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ class DbSelect implements AdapterInterface
* @param Select $select The select query
* @param Adapter|Sql $adapterOrSqlObject DB adapter or Sql object
* @param null|ResultSetInterface $resultSetPrototype
* @throws Exception\InvalidArgumentException
*/
public function __construct(Select $select, $adapterOrSqlObject, ResultSetInterface $resultSetPrototype = null)
{
Expand Down
8 changes: 4 additions & 4 deletions src/Paginator.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
use Zend\Cache\Storage\IteratorInterface as CacheIterator;
use Zend\Cache\Storage\StorageInterface as CacheStorage;
use Zend\Db\Sql;
use Zend\Db\ResultSet\AbstractResultSet;
use Zend\Filter\FilterInterface;
use Zend\Json\Json;
use Zend\Paginator\Adapter\AdapterInterface;
Expand Down Expand Up @@ -826,11 +827,10 @@ public function toJson()
{
$currentItems = $this->getCurrentItems();

if ($currentItems instanceof DbAbstractRowset) {
if ($currentItems instanceof AbstractResultSet) {
return Json::encode($currentItems->toArray());
} else {
return Json::encode($currentItems);
}
return Json::encode($currentItems);
}

/**
Expand Down Expand Up @@ -892,7 +892,7 @@ protected function _calculatePageCount()
* Creates the page collection.
*
* @param string $scrollingStyle Scrolling style
* @return stdClass
* @return \stdClass
*/
protected function _createPages($scrollingStyle = null)
{
Expand Down

0 comments on commit 33e79d4

Please sign in to comment.