97 throw new InvalidArgumentException(
'Batch size must be at least 1 row.' );
103 $this->orderBy = implode(
' ASC,', $this->primaryKey ) .
' ASC';
128 $this->joinConditions = array_merge( $this->joinConditions,
$conditions );
137 if ( count( $columns ) === 1 && reset( $columns ) ===
'*' ) {
138 $this->fetchColumns = $columns;
140 $this->fetchColumns = array_unique( array_merge(
155 foreach ( $this->primaryKey as $alias => $column ) {
156 $name = is_numeric( $alias ) ? $column : $alias;
157 $pk[
$name] = $row->{$name};
166 return $this->current;
189 return (
bool)$this->current;
196 return $this->current && count( $this->current );
210 $res = $this->db->select(
213 $this->buildConditions(),
216 'LIMIT' => $this->batchSize,
217 'ORDER BY' => $this->orderBy,
219 $this->joinConditions
225 $this->current = iterator_to_array(
$res );
242 if ( !$this->current ) {
243 return $this->conditions;
246 $maxRow = end( $this->current );
248 foreach ( $this->primaryKey as $alias => $column ) {
249 $name = is_numeric( $alias ) ? $column : $alias;
250 $maximumValues[$column] = $this->db->addQuotes( $maxRow->{$name} );
261 while ( $maximumValues ) {
262 $pkConditions[] = $this->buildGreaterThanCondition( $maximumValues );
263 array_pop( $maximumValues );
266 $conditions = $this->conditions;
267 $conditions[] = sprintf(
'( %s )', implode(
' ) OR ( ', $pkConditions ) );
285 $keys = array_keys( $quotedMaximumValues );
286 $lastColumn = end(
$keys );
287 $lastValue = array_pop( $quotedMaximumValues );
289 foreach ( $quotedMaximumValues as $column =>
$value ) {
290 $conditions[] =
"$column = $value";
292 $conditions[] =
"$lastColumn > $lastValue";
294 return implode(
' AND ', $conditions );
and give any other recipients of the Program a copy of this License along with the Program You may charge a fee for the physical act of transferring a and you may at your option offer warranty protection in exchange for a fee You may modify your copy or copies of the Program or any portion of thus forming a work based on the and copy and distribute such modifications or work under the terms of Section provided that you also meet all of these conditions
to add to the query
next()
Fetch the next set of rows from the database.
addConditions(array $conditions)
rewind()
Reset the iterator to the begining of the table.
array $options
Additional query options.
addJoinConditions(array $conditions)
setFetchColumns(array $columns)
extractPrimaryKeys( $row)
Extracts the primary key(s) from a database row.
addOptions(array $options)
int $key
key 0-indexed number of pages fetched since self::reset()
buildGreaterThanCondition(array $quotedMaximumValues)
Given an array of column names and their maximum value generate an SQL condition where all keys excep...
buildConditions()
Uses the primary key list and the maximal result row from the previous iteration to build an SQL cond...
__construct(IDatabase $db, $table, $primaryKey, $batchSize)
deferred txt A few of the database updates required by various functions here can be deferred until after the result page is displayed to the user For updating the view updating the linked to tables after a etc PHP does not yet have any way to tell the server to actually return and disconnect while still running these but it might have such a feature in the future We handle these by creating a deferred update object and putting those objects on a global then executing the whole list after the page is displayed We don t do anything smart like collating updates to the same table or such because the list is almost always going to have just one item on if so it s not worth the trouble Since there is a job queue in the jobs table
design txt This is a brief overview of the new design More thorough and up to date information is available on the documentation wiki at etc Handles the details of getting and saving to the user table of the and dealing with sessions and cookies OutputPage Encapsulates the entire HTML page that will be sent in response to any server request It is used by calling its functions to add in any and then calling but I prefer the flexibility This should also do the output encoding The system allocates a global one in $wgOut Title Represents the title of an and does all the work of translating among various forms such as plain database key
the array() calling protocol came about after MediaWiki 1.4rc1.
We ve cleaned up the code here by removing clumps of infrequently used code and moving them off somewhere else It s much easier for someone working with this code to see what s _really_ going and make changes or fix bugs In we can take all the code that deals with the little used title reversing options(say) and put it in one place. Instead of having little title-reversing if-blocks spread all over the codebase in showAnArticle
Allows to change the fields on the form that will be generated $name