MediaWiki REL1_31
DuplicateJob.php
Go to the documentation of this file.
1<?php
29final class DuplicateJob extends Job {
36 function __construct( Title $title, array $params ) {
37 parent::__construct( 'duplicate', $title, $params );
38 }
39
46 public static function newFromJob( Job $job ) {
47 $djob = new self( $job->getTitle(), $job->getParams() );
48 $djob->command = $job->getType();
49 $djob->params = is_array( $djob->params ) ? $djob->params : [];
50 $djob->params = [ 'isDuplicate' => true ] + $djob->params;
51 $djob->metadata = $job->metadata;
52
53 return $djob;
54 }
55
56 public function run() {
57 return true;
58 }
59}
No-op job that does nothing.
static newFromJob(Job $job)
Get a duplicate no-op version of a job.
run()
Run the job.
__construct(Title $title, array $params)
Callers should use DuplicateJob::newFromJob() instead.
Class to both describe a background job and handle jobs.
Definition Job.php:31
array $params
Array of job parameters.
Definition Job.php:36
Represents a title within MediaWiki.
Definition Title.php:39
null means default in associative array with keys and values unescaped Should be merged with default with a value of false meaning to suppress the attribute in associative array with keys and values unescaped noclasses just before the function returns a value If you return true
Definition hooks.txt:2006
if(count( $args)< 1) $job