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

 Methods

Constructor.

__construct(\Zend_Db_Select $select) 
Inherited

Parameters

$select

\Zend_Db_Select

The select query

Returns the total number of rows in the result set.

count() : integer
Inherited

Returns

integer

Returns the cache identifier.

getCacheIdentifier() : string
Inherited

Returns

string

Get the COUNT select object for the provided query

getCountSelect() : \Zend_Db_Select
Inherited

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

\Zend_Db_Select

Returns a Zend_Db_Table_Rowset_Abstract of items for a page.

getItems(integer $offset, integer $itemCountPerPage) : \Zend_Db_Table_Rowset_Abstract
inherited_from \Zend_Paginator_Adapter_DbSelect::getItems()

Parameters

$offset

integer

Page offset

$itemCountPerPage

integer

Number of items per page

Returns

\Zend_Db_Table_Rowset_Abstract

Returns an array of items for a page.

getItems(integer $offset, integer $itemCountPerPage) : array
Inherited
inherited_from \Zend_Paginator_Adapter_Interface::getItems()

Parameters

$offset

integer

Page offset

$itemCountPerPage

integer

Number of items per page

Returns

array

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 .

setRowCount($rowCount) : \Zend_Paginator_Adapter_DbSelect
Inherited

.. 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. Users are therefore encouraged to profile their queries to find the solution that best meets their needs.

Parameters

$rowCount

Exceptions

\Zend_Paginator_Exception

Returns

\Zend_Paginator_Adapter_DbSelect$this

 Properties

 

Identifies this adapter for caching purposes. This value will remain constant for the entire life of this adapter regardless of how many different pages are queried.

$_cacheIdentifier : string

Default

null
 

The COUNT query

$_countSelect : \Zend_Db_Select

Default

null
 

Total item count

$_rowCount : integer

Default

null
 

Database query

$_select : \Zend_Db_Select

Default

null

 Constants

 

Name of the row count column

ROW_COUNT_COLUMN = 'zend_paginator_row_count' : string