MediaWiki master
RevertedTagUpdateManager.php
Go to the documentation of this file.
1<?php
7namespace MediaWiki\Storage;
8
11
22
24 private $jobQueueGroup;
25
27 private $editResultCache;
28
29 public function __construct(
30 EditResultCache $editResultCache,
31 JobQueueGroup $jobQueueGroup
32 ) {
33 $this->jobQueueGroup = $jobQueueGroup;
34 $this->editResultCache = $editResultCache;
35 }
36
47 public function approveRevertedTagForRevision( int $revertRevisionId ): bool {
48 $editResult = $this->editResultCache->get( $revertRevisionId );
49 if ( $editResult === null || !$editResult->isRevert() ) {
50 return false;
51 }
52
53 $spec = RevertedTagUpdateJob::newSpec( $revertRevisionId, $editResult );
54 $this->jobQueueGroup->lazyPush( $spec );
55 return true;
56 }
57}
Handle enqueueing of background jobs.
Job for deferring the execution of RevertedTagUpdate.
static newSpec(int $revertRevisionId, EditResult $editResult)
Returns a JobSpecification for this job.
Class allowing easy storage and retrieval of EditResults associated with revisions.
Class for managing delayed RevertedTagUpdateJob waiting for user approval.
approveRevertedTagForRevision(int $revertRevisionId)
Enqueue a RevertedTagUpdateJob for the given revision, if needed.
__construct(EditResultCache $editResultCache, JobQueueGroup $jobQueueGroup)