DbTableGateway.php #1

  • //
  • guest/
  • thomas_gray/
  • jambox/
  • main/
  • swarm/
  • library/
  • Zend/
  • Paginator/
  • Adapter/
  • DbTableGateway.php
  • View
  • Commits
  • Open Download .zip Download (1 KB)
<?php
/**
 * Zend Framework (http://framework.zend.com/)
 *
 * @link      http://github.com/zendframework/zf2 for the canonical source repository
 * @copyright Copyright (c) 2005-2014 Zend Technologies USA Inc. (http://www.zend.com)
 * @license   http://framework.zend.com/license/new-bsd New BSD License
 */

namespace Zend\Paginator\Adapter;

use Zend\Db\Sql\Where;
use Zend\Db\TableGateway\TableGateway;

class DbTableGateway extends DbSelect
{
    /**
     * Constructs instance.
     *
     * @param TableGateway                $tableGateway
     * @param Where|\Closure|string|array $where
     * @param null                        $order
     */
    public function __construct(TableGateway $tableGateway, $where = null, $order = null)
    {
        $select = $tableGateway->getSql()->select();
        if ($where) {
            $select->where($where);
        }
        if ($order) {
            $select->order($order);
        }

        $dbAdapter          = $tableGateway->getAdapter();
        $resultSetPrototype = $tableGateway->getResultSetPrototype();

        parent::__construct($select, $dbAdapter, $resultSetPrototype);
    }
}
# Change User Description Committed
#1 18334 Liz Lam initial add of jambox