API Documentation

Paginator/Adapter/DbTableSelect.php

Zend Framework

LICENSE

This source file is subject to the new BSD license that is bundled with this package in the file LICENSE.txt. It is also available through the world-wide-web at this URL: http://framework.zend.com/license/new-bsd If you did not receive a copy of the license and are unable to obtain it through the world-wide-web, please send an email to license@zend.com so we can send you a copy immediately.

category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Paginator  
version
$Id: DbTableSelect.php 23775 2011-03-01 17:25:24Z ralph $  

\Zend_Paginator_Adapter_DbTableSelect

Extends from
\Zend_Paginator_Adapter_DbSelect
category
Zend  
copyright
Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)  
license
New BSD License  
package
Zend_Paginator  

Methods

methodpublic__construct( \Zend_Db_Select $select ) : void
Parameters
Name Type Description
$select \Zend_Db_Select The select query
methodpubliccount( ) : integer

Returns the total number of rows in the result set.

Inherited from: \Zend_Paginator_Adapter_DbSelect::count()
Returns
Type Description
integer
methodpublicgetCountSelect( ) : \Zend_Db_Select

Get the COUNT select object for the provided query

Inherited from: \Zend_Paginator_Adapter_DbSelect::getCountSelect()

TODO: Have a look at queries that have both GROUP BY and DISTINCT specified. In that use-case I'm expecting problems when either GROUP BY or DISTINCT has one column.

Returns
Type Description
\Zend_Db_Select
methodpublicgetItems( integer $offset, integer $itemCountPerPage ) : \Zend_Db_Table_Rowset_Abstract

Returns a Zend_Db_Table_Rowset_Abstract of items for a page.

Parameters
Name Type Description
$offset integer Page offset
$itemCountPerPage integer Number of items per page
Returns
Type Description
\Zend_Db_Table_Rowset_Abstract
methodpublicsetRowCount(  $rowCount ) : \Zend_Paginator_Adapter_DbSelect

Sets the total row count, either directly or through a supplied query. Without setting this, {@link getPages()} selects the count as a subquery (SELECT COUNT ... FROM (SELECT ...)). While this yields an accurate count even with queries containing clauses like LIMIT, it can be slow in some circumstances. For example, in MySQL, subqueries are generally slow when using the InnoDB storage engine.

Inherited from: \Zend_Paginator_Adapter_DbSelect::setRowCount()

Users are therefore encouraged to profile their queries to find the solution that best meets their needs.

Parameters
Name Type Description
$rowCount
Returns
Type Description
\Zend_Paginator_Adapter_DbSelect $this
Throws
Exception Description
\Zend_Paginator_Exception
Documentation was generated by DocBlox 0.13.3.