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

 Methods

Constructor.

__construct(\Zend_Db_Select $select) 

Parameters

$select

\Zend_Db_Select

The select query

Returns the total number of rows in the result set.

count() : integer

Returns

integer

Returns the cache identifier.

getCacheIdentifier() : string

Returns

string

Get the COUNT select object for the provided query

getCountSelect() : \Zend_Db_Select

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 an array of items for a page.

getItems(integer $offset, integer $itemCountPerPage) : array
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

.. 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