MediaWiki master
MediaWiki\Utils\BatchRowWriter Class Reference
Collaboration diagram for MediaWiki\Utils\BatchRowWriter:

Public Member Functions

 __construct (IDatabase $db, $table, $clusterName=false)
 
 setCaller ( $caller)
 Use ->setCaller( METHOD ) to indicate which code is using this class.
 
 write (array $updates)
 

Protected Attributes

string null $caller
 For debugging which method is using this class.
 
string false $clusterName
 A cluster name valid for use with LBFactory.
 
IDatabase $db
 The database to write to.
 
string $table
 The name of the table to update.
 

Detailed Description

Definition at line 15 of file BatchRowWriter.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Utils\BatchRowWriter::__construct ( IDatabase $db,
$table,
$clusterName = false )
Parameters
IDatabase$dbThe database to write to
string$tableThe name of the table to update
string | false$clusterNameA cluster name valid for use with LBFactory

Definition at line 41 of file BatchRowWriter.php.

References MediaWiki\Utils\BatchRowWriter\$clusterName, MediaWiki\Utils\BatchRowWriter\$db, and MediaWiki\Utils\BatchRowWriter\$table.

Member Function Documentation

◆ setCaller()

MediaWiki\Utils\BatchRowWriter::setCaller ( $caller)

Use ->setCaller( METHOD ) to indicate which code is using this class.

Only used in debugging output.

Since
1.36
Parameters
string$caller
Returns
self

Definition at line 55 of file BatchRowWriter.php.

References MediaWiki\Utils\BatchRowWriter\$caller.

◆ write()

MediaWiki\Utils\BatchRowWriter::write ( array $updates)
Parameters
array[][]$updatesArray of arrays each containing two keys, 'primaryKey' and 'changes'. primaryKey must contain a map of column names to values sufficient to uniquely identify the row. changes must contain a map of column names to update values to apply to the row.

Definition at line 67 of file BatchRowWriter.php.

References MediaWiki\Utils\BatchRowWriter\$caller, and MediaWiki\MediaWikiServices\getInstance().

Member Data Documentation

◆ $caller

string null MediaWiki\Utils\BatchRowWriter::$caller
protected

For debugging which method is using this class.

Definition at line 34 of file BatchRowWriter.php.

Referenced by MediaWiki\Utils\BatchRowWriter\setCaller(), and MediaWiki\Utils\BatchRowWriter\write().

◆ $clusterName

string false MediaWiki\Utils\BatchRowWriter::$clusterName
protected

A cluster name valid for use with LBFactory.

Definition at line 29 of file BatchRowWriter.php.

Referenced by MediaWiki\Utils\BatchRowWriter\__construct().

◆ $db

IDatabase MediaWiki\Utils\BatchRowWriter::$db
protected

The database to write to.

Definition at line 19 of file BatchRowWriter.php.

Referenced by MediaWiki\Utils\BatchRowWriter\__construct().

◆ $table

string MediaWiki\Utils\BatchRowWriter::$table
protected

The name of the table to update.

Definition at line 24 of file BatchRowWriter.php.

Referenced by MediaWiki\Utils\BatchRowWriter\__construct().


The documentation for this class was generated from the following file: