|
| buildConditions () |
| Uses the primary key list and the maximal result row from the previous iteration to build an SQL condition sufficient for selecting the next page of results. More...
|
|
| buildGreaterThanCondition (array $quotedMaximumValues) |
| Given an array of column names and their maximum value generate an SQL condition where all keys except the last match $quotedMaximumValues exactly and the last column is greater than the matching value in $quotedMaximumValues. More...
|
|
Definition at line 29 of file BatchRowIterator.php.
◆ __construct()
BatchRowIterator::__construct |
( |
IDatabase |
$db, |
|
|
|
$table, |
|
|
|
$primaryKey, |
|
|
|
$batchSize |
|
) |
| |
- Parameters
-
IDatabase | $db | The database to read from |
string | array | $table | The name or names of the table to read from |
string | array | $primaryKey | The name or names of the primary key columns |
int | $batchSize | The number of rows to fetch per iteration |
- Exceptions
-
Definition at line 95 of file BatchRowIterator.php.
References $batchSize, $db, $primaryKey, $table, array(), and table.
◆ addConditions()
BatchRowIterator::addConditions |
( |
array |
$conditions | ) |
|
◆ addJoinConditions()
BatchRowIterator::addJoinConditions |
( |
array |
$conditions | ) |
|
◆ addOptions()
BatchRowIterator::addOptions |
( |
array |
$options | ) |
|
◆ buildConditions()
BatchRowIterator::buildConditions |
( |
| ) |
|
|
protected |
Uses the primary key list and the maximal result row from the previous iteration to build an SQL condition sufficient for selecting the next page of results.
All except the final key use =
conditions while the final key uses a >
condition
Example output: [ '( foo = 42 AND bar > 7 ) OR ( foo > 42 )' ]
- Returns
- array The SQL conditions necessary to select the next set of rows in the batched query
Definition at line 241 of file BatchRowIterator.php.
References $name, and as.
◆ buildGreaterThanCondition()
BatchRowIterator::buildGreaterThanCondition |
( |
array |
$quotedMaximumValues | ) |
|
|
protected |
Given an array of column names and their maximum value generate an SQL condition where all keys except the last match $quotedMaximumValues exactly and the last column is greater than the matching value in $quotedMaximumValues.
- Parameters
-
array | $quotedMaximumValues | The maximum values quoted with $this->db->addQuotes() |
- Returns
- string An SQL condition that will select rows where all columns match the maximum value exactly except the last column which must be greater than the provided maximum value
Definition at line 284 of file BatchRowIterator.php.
References $keys, $value, and as.
◆ current()
BatchRowIterator::current |
( |
| ) |
|
- Returns
- array The most recently fetched set of rows from the database
Definition at line 165 of file BatchRowIterator.php.
◆ extractPrimaryKeys()
BatchRowIterator::extractPrimaryKeys |
( |
|
$row | ) |
|
Extracts the primary key(s) from a database row.
- Parameters
-
stdClass | $row | An individual database row from this iterator |
- Returns
- array Map of primary key column to value within the row
Definition at line 153 of file BatchRowIterator.php.
References $name, and as.
◆ getChildren()
BatchRowIterator::getChildren |
( |
| ) |
|
◆ hasChildren()
BatchRowIterator::hasChildren |
( |
| ) |
|
◆ key()
array $primaryKey The name of the primary BatchRowIterator::key |
( |
| ) |
|
◆ next()
BatchRowIterator::next |
( |
| ) |
|
◆ rewind()
BatchRowIterator::rewind |
( |
| ) |
|
◆ setFetchColumns()
BatchRowIterator::setFetchColumns |
( |
array |
$columns | ) |
|
◆ valid()
BatchRowIterator::valid |
( |
| ) |
|
◆ $batchSize
BatchRowIterator::$batchSize |
|
protected |
◆ $conditions
BatchRowIterator::$conditions = [] |
|
protected |
◆ $current
BatchRowIterator::$current = [] |
|
private |
◆ $db
◆ $fetchColumns
BatchRowIterator::$fetchColumns |
|
protected |
◆ $joinConditions
array BatchRowIterator::$joinConditions = [] |
|
protected |
◆ $key
int BatchRowIterator::$key |
|
private |
◆ $options
array BatchRowIterator::$options = [] |
|
protected |
◆ $orderBy
BatchRowIterator::$orderBy |
|
protected |
◆ $primaryKey
BatchRowIterator::$primaryKey |
|
protected |
◆ $table
The documentation for this class was generated from the following file: