miModelSQLRecordsetHandle and manage the reading of data from database.
This class only read data from a given database table with necessary ordering and filtering.
Located in /model/SQLRecordset.inc (line 25)
Constructor miModelSQLRecordset (line 94)
miModelSQLRecordset constructor. It takes one parameter - table name
Example:
1 <?php
2 $ModelSQLRecordset = new miModelSQLRecordset('tableName');
3 ?>
addFilter (line 138)
Sets an array that hold the all filter parameters for the execution of the query.
Example:
1 <?php
2 $ModelSQLRecordset = new miModelSQLRecordset('tableName');
3 $ModelSQLRecordset->addFilter($arrayFilter);
4 ?>
addHiddenFilter (line 158)
Sets an array that hold the hidden filter parameters for the execution of the query.
Example:
1 <?php
2 $ModelSQLRecordset = new miModelSQLRecordset('tableName');
3 $ModelSQLRecordset->addHiddenFilter($arrayFilter);
4 ?>
getFields (line 235)
getRecords (line 203)
Read rows from a database table.
The result reply to the given filter clause and is returned in order specify by order clause
Example:
1 <?php
2 $ModelSQLRecordset = new miModelSQLRecordset('tableName');
3 $ModelSQLRecordset->setOrder($tableField, 'ASC');
4 $ModelSQLRecordset->addFilter($arrayFilter);
5 $rows = $ModelSQLRecordset->getRecords();
6 ?>
getRecordsByIndex (line 344)
Read fixed number of rows from a given index in a database table.
The result reply to the given filter clause and is returned in order specify by order clause
Example:
1 <?php
2 $ModelSQLRecordset = new miModelSQLRecordset('tableName');
3 $ModelSQLRecordset->setOrder($tableField, 'ASC');
4 $ModelSQLRecordset->addFilter($arrayFilter);
5 $rows = $ModelSQLRecordset->getRecordsByIndex($fromIndex, $numRecords);
6 ?>
getRecordsCount (line 308)
Return the number of all rows in a database table that reply to the given filter clause
Example:
1 <?php
2 $ModelSQLRecordset = new miModelSQLRecordset('tableName');
3 $ModelSQLRecordset->addFilter($arrayFilter);
4 $count = $ModelSQLRecordset->getRecordsCount();
5 ?>
getSqlOrderClause (line 224)
Return the order clause
Example:
1 <?php
2 $ModelSQLRecordset = new miModelSQLRecordset('tableName');
3 $ModelSQLRecordset->setOrder($tableField, 'ASC');
4 $order = $ModelSQLRecordset->getSqlOrderClause();
5 ?>
setOrder (line 116)
Sets the field by which the result of the query will be ordered and the direction of ordering - ascending or descending.
Example:
1 <?php
2 $ModelSQLRecordset = new miModelSQLRecordset('tableName');
3 $ModelSQLRecordset->setOrder($tableField, 'ASC');
4 ?>
setRecordsLimit (line 178)
Sets how many rows to be read from the databse
Example:
1 <?php
2 $ModelSQLRecordset = new miModelSQLRecordset('tableName');
3 $ModelSQLRecordset->setRecordsLimit(5, 20);
4 ?>
Documentation generated on Mon, 18 Oct 2004 14:58:32 +0300 by phpDocumentor 1.2.3