protected $mDb;
/** @var array SELECT options to be used (array) */
- protected $mOptions = array();
+ protected $mOptions = [];
/** @var bool Whether a transaction is open on this object (internal use only!) */
private $mHasTransaction;
* Abort the database transaction started via beginTransaction (if any).
*/
public function abortTransaction() {
- if ( $this->mHasTransaction ) { //XXX: actually... maybe always?
+ if ( $this->mHasTransaction ) { // XXX: actually... maybe always?
$this->mDb->rollback( get_class( $this ) . '::abortTransaction' );
$this->mHasTransaction = false;
}
* @param array $dbkeys
*/
protected function invalidatePages( $namespace, array $dbkeys ) {
- if ( $dbkeys === array() ) {
+ if ( $dbkeys === [] ) {
return;
}
$now = $dbw->timestamp();
$ids = $dbw->selectFieldValues( 'page',
'page_id',
- array(
+ [
'page_namespace' => $namespace,
'page_title' => $dbkeys,
'page_touched < ' . $dbw->addQuotes( $now )
- ),
+ ],
__METHOD__
);
- if ( $ids === array() ) {
+ if ( $ids === [] ) {
return;
}
* the non-locking select above.
*/
$dbw->update( 'page',
- array( 'page_touched' => $now ),
- array(
+ [ 'page_touched' => $now ],
+ [
'page_id' => $ids,
'page_touched < ' . $dbw->addQuotes( $now )
- ), __METHOD__
+ ], __METHOD__
);
} );
}