Paginator/Adapter/DbTableSelect.php

Show: inherited
Table of Contents

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 [email protected] so we can send you a copy immediately.

Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  
Package
Zend_Paginator  
Version
$Id: DbTableSelect.php 24593 2012-01-05 20:35:02Z matthew $  

\Zend_Paginator_Adapter_DbTableSelect

Package: Zend\Paginator

Parent(s)
\Zend_Paginator_Adapter_DbSelect
Category
Zend  
Copyright
Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)  
License
New BSD License  

Constants

Constantstring  ROW_COUNT_COLUMN = 'zend_paginator_row_count'
inherited

Name of the row count column

Inherited from: \Zend_Paginator_Adapter_DbSelect::ROW_COUNT_COLUMN

Properties

Propertyprotectedstring $_cacheIdentifier = null
inherited

Identifies this adapter for caching purposes.

Inherited from: \Zend_Paginator_Adapter_DbSelect::$$_cacheIdentifier

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

Default valuenullDetails
Type
string
Inherited_from
\Zend_Paginator_Adapter_DbSelect::$$_cacheIdentifier  
Propertyprotected\Zend_Db_Select $_countSelect = null
inherited

The COUNT query

Inherited from: \Zend_Paginator_Adapter_DbSelect::$$_countSelect
Default valuenullDetails
Type
\Zend_Db_Select
Inherited_from
\Zend_Paginator_Adapter_DbSelect::$$_countSelect  
Propertyprotectedinteger $_rowCount = null
inherited

Total item count

Inherited from: \Zend_Paginator_Adapter_DbSelect::$$_rowCount
Default valuenullDetails
Type
integer
Inherited_from
\Zend_Paginator_Adapter_DbSelect::$$_rowCount  
Propertyprotected\Zend_Db_Select $_select = null
inherited

Database query

Inherited from: \Zend_Paginator_Adapter_DbSelect::$$_select
Default valuenullDetails
Type
\Zend_Db_Select
Inherited_from
\Zend_Paginator_Adapter_DbSelect::$$_select  

Methods

methodpublic__construct(\Zend_Db_Select $select) : void
inherited

Constructor.

Inherited from: \Zend_Paginator_Adapter_DbSelect::__construct()
Parameters
Name Type Description
$select \Zend_Db_Select

The select query

methodpubliccount() : integer
inherited

Returns the total number of rows in the result set.

Inherited from: \Zend_Paginator_Adapter_DbSelect::count()
Returns
Type Description
integer
methodpublicgetCacheIdentifier() : string
inherited

Returns the cache identifier.

Inherited from: \Zend_Paginator_Adapter_DbSelect::getCacheIdentifier()
Returns
Type Description
string
methodpublicgetCountSelect() : \Zend_Db_Select
inherited

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
inherited

Sets the total row count, either directly or through a supplied query.

Inherited from: \Zend_Paginator_Adapter_DbSelect::setRowCount()

Without setting this, 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. 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 phpDocumentor 2.0.0a8.