MediaWiki master
UserEditCountInitJob.php
Go to the documentation of this file.
1<?php
22
37
38 public function __construct( array $params ) {
39 parent::__construct( 'userEditCountInit', $params );
40 $this->removeDuplicates = true;
41 }
42
43 public function run() {
44 $dbw = MediaWikiServices::getInstance()->getConnectionProvider()->getPrimaryDatabase();
45
46 $dbw->newUpdateQueryBuilder()
47 ->update( 'user' )
48 ->set( [ 'user_editcount' => $this->params['editCount'] ] )
49 ->where( [
50 'user_id' => $this->params['userId'],
51 $dbw->expr( 'user_editcount', '=', null )->or( 'user_editcount', '<', $this->params['editCount'] )
52 ] )
53 ->caller( __METHOD__ )->execute();
54
55 return true;
56 }
57}
array $params
The job parameters.
Describe and execute a background job.
Definition Job.php:38
Service locator for MediaWiki core services.
Job that initializes an user's edit count.
Interface for generic jobs only uses the parameters field and are JSON serializable.