完善分页服务中针对TableGateway的部分

This commit is contained in:
Jianxuan Li 2015-02-05 15:11:15 +08:00
parent 8c7acba4ef
commit 2e3fec30cd
1 changed files with 2 additions and 2 deletions

View File

@ -16,7 +16,7 @@ use Zend\Paginator\Adapter\DbSelect;
use Zend\Paginator\Adapter\DbTableGateway; use Zend\Paginator\Adapter\DbTableGateway;
use Zend\Paginator\Paginator as Zend_Paginator; use Zend\Paginator\Paginator as Zend_Paginator;
use Zend\Db\Sql\Select; use Zend\Db\Sql\Select;
use Zend\Db\TableGateway\TableGateway; use Zend\Db\TableGateway;
class Paginator implements ServiceManagerAwareInterface{ class Paginator implements ServiceManagerAwareInterface{
@ -113,7 +113,7 @@ class Paginator implements ServiceManagerAwareInterface{
$data = new DbSelect($data,$zendDb); $data = new DbSelect($data,$zendDb);
} }
if($data instanceof TableGateway) if($data instanceof TableGateway\TableGatewayInterface || $data instanceof TableGateway\AbstractTableGateway)
$data = new DbTableGateway($data,$this->sqlQuery,$this->sqlOrder,$this->sqlGroup,$this->sqlHaving); $data = new DbTableGateway($data,$this->sqlQuery,$this->sqlOrder,$this->sqlGroup,$this->sqlHaving);
$paginator = new Zend_Paginator($data); $paginator = new Zend_Paginator($data);