* @ingroup JobQueue
*/
abstract class Job {
- /** @var int Job identifier */
- public $id;
-
/** @var string */
public $command;
* @param $command
* @param $title
* @param $params array|bool
- * @param $id int
*/
- public function __construct( $command, $title, $params = false, $id = 0 ) {
+ public function __construct( $command, $title, $params = false ) {
$this->command = $command;
$this->title = $title;
$this->params = $params;
- $this->id = $id;
// expensive jobs may set this to true
$this->removeDuplicates = false;
}
- /**
- * @return int May be 0 for jobs stored outside the DB
- * @deprecated since 1.22
- */
- public function getId() {
- return $this->id;
- }
-
/**
* @return string
*/
$job = Job::factory( $row->job_cmd, $title,
self::extractBlob( $row->job_params ), $row->job_id );
$job->metadata['id'] = $row->job_id;
- $job->id = $row->job_id; // XXX: work around broken subclasses
break; // done
} while ( true );
} catch ( DBError $e ) {
$job = Job::factory(
$row->job_cmd,
Title::makeTitle( $row->job_namespace, $row->job_title ),
- strlen( $row->job_params ) ? unserialize( $row->job_params ) : false,
- $row->job_id
+ strlen( $row->job_params ) ? unserialize( $row->job_params ) : false
);
$job->metadata['id'] = $row->job_id;
- $job->id = $row->job_id; // XXX: work around broken subclasses
return $job;
}
);
*
* @param Title $title
* @param array $params job parameters
- * @param $id Integer: job id
*/
- function __construct( $title, $params, $id = 0 ) {
- parent::__construct( 'duplicate', $title, $params, $id );
+ function __construct( $title, $params ) {
+ parent::__construct( 'duplicate', $title, $params );
}
/**
* @return Job
*/
public static function newFromJob( Job $job ) {
- $djob = new self( $job->getTitle(), $job->getParams(), $job->id );
+ $djob = new self( $job->getTitle(), $job->getParams() );
$djob->command = $job->getType();
$djob->params = is_array( $djob->params ) ? $djob->params : array();
$djob->params = array( 'isDuplicate' => true ) + $djob->params;