如何获得SQL_CALC_FOUND_ROWS与Zend\Db\TableGateway不使用直接低水平的查询与原始的SQL?
class ProductTable {
protected $tableGateway;
/**
* Set database gateway
*
* @param TableGateway $tableGateway - database connection
* @return void
*/
public function __construct(TableGateway $tableGateway) {
$this->tableGateway = $tableGateway;
}
/**
* Fetch all products
*
* @param integer $page - page of records
* @param integer $perpage - records per page
* @return void
*/
public function fetchAll($page = 1, $perpage = 18) {
return $this->tableGateway->select(function (Select $select) use ($page, $perpage) {
$select …Run Code Online (Sandbox Code Playgroud)