jargon
[ class tree: jargon ] [ index: jargon ] [ all elements ]

Class: PagedQuery

Source Location: /jargon/PagedQuery.php

Class Overview

Query
   |
   --PagedQuery

Class for representing a SQL query for retrieving paged results from a database.


Author(s):

Version:

  • $Revision: 1.5 $

Methods


Inherited Variables

Inherited Methods

Class: Query

Query::__construct()
Create a new Query.
Query::getAssoc()
Fetch the entire result set of a query and return it as an associative array using the first column as the key.
Query::getCol()
Gets array of values for first column in result set.
Query::getDataSet()
Gets a QueryDataSet representing results of this query.
Query::getOne()
Gets value of first column of first returned row.
Query::getRow()
Gets first rows (hash).
Query::getRows()
Gets array of rows (hashes).
Query::setMax()
Sets max rows (limit).
Query::setSql()
Sets the SQL we are using.
Query::setStart()
Sets the start row or offset.

Class Details

[line 35]
Class for representing a SQL query for retrieving paged results from a database.

Note that this class is for retrieving results and not performing updates.




Tags:

version:  $Revision: 1.5 $
author:  Hans Lellelid <hans@xmpl.org>


[ Top ]


Class Methods


constructor __construct [line 45]

PagedQuery __construct( Connection $conn, [string $sql = null], [mixed $page = 1], [mixed $rowsPerPage = 25])

Create a new Query.



Tags:

access:  public


Overrides Query::__construct() (Create a new Query.)

Parameters:

Connection   $conn  
string   $sql  

[ Top ]

method getPage [line 68]

int getPage( )

Get current page.



Tags:

access:  public


[ Top ]

method getRowsPerPage [line 88]

int getRowsPerPage( )

Get number of rows per page.



Tags:

access:  public


[ Top ]

method getTotalRecordCount [line 112]

int getTotalRecordCount( )

Gets the total number (un-LIMITed) of records.

This method will perform a query that executes un-LIMITed query. This method is not performance-conscious, so don't call this repeatedly for the same query.




Tags:

return:  Total number of records - disregarding page, maxrows, etc.
access:  public
throws:  SQLException


[ Top ]

method setPage [line 57]

void setPage( int $page)

Set the current page number (First page is 1).



Tags:

access:  public


Parameters:

int   $page  

[ Top ]

method setRowsPerPage [line 77]

void setRowsPerPage( int $r)

Set the number of rows per page.



Tags:

access:  public


Parameters:

int   $r  

[ Top ]


Documentation generated on Mon, 23 Aug 2004 21:52:31 -0400 by phpDocumentor 1.3.0RC3