Merge "Improve docs for Title::getInternalURL/getCanonicalURL"
[lhc/web/wiklou.git] / includes / jobqueue / jobs / DeletePageJob.php
1 <?php
2
3 /**
4 * Class DeletePageJob
5 */
6 class DeletePageJob extends Job {
7 public function __construct( $title, $params = [] ) {
8 parent::__construct( 'deletePage', $title, $params );
9 }
10
11 /**
12 * Execute the job
13 *
14 * @return bool
15 */
16 public function run() {
17 // Failure to load the page is not job failure.
18 // A parallel deletion operation may have already completed the page deletion.
19 $wikiPage = WikiPage::newFromID( $this->params['wikiPageId'] );
20 if ( $wikiPage ) {
21 $wikiPage->doDeleteArticleBatched(
22 $this->params['reason'],
23 $this->params['suppress'],
24 User::newFromId( $this->params['userId'] ),
25 json_decode( $this->params['tags'] ),
26 $this->params['logsubtype'],
27 false,
28 $this->getRequestId() );
29 }
30 return true;
31 }
32 }