79 public function write( array $updates ) {
80 $dbProvider = MediaWikiServices::getInstance()->getConnectionProvider();
81 $ticket = $dbProvider->getEmptyTransactionTicket( __METHOD__ );
84 if ( (
string)$this->caller !==
'' ) {
85 $caller .=
" (for {$this->caller})";
88 foreach ( $updates as $update ) {
89 $this->db->newUpdateQueryBuilder()
90 ->update( $this->table )
91 ->set( $update[
'changes'] )
92 ->where( $update[
'primaryKey'] )
96 $dbProvider->commitAndWaitForReplication( __METHOD__, $ticket );
string null $caller
For debugging which method is using this class.
__construct(IDatabase $db, $table, $clusterName=false)
setCaller( $caller)
Use ->setCaller( METHOD ) to indicate which code 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.