MediaWiki  master
RevertedTagUpdateManager.php
Go to the documentation of this file.
1 <?php
23 namespace MediaWiki\Storage;
24 
25 use JobQueueGroup;
27 
37 
39  private $jobQueueGroup;
40 
43 
48  public function __construct(
51  ) {
52  $this->jobQueueGroup = $jobQueueGroup;
53  $this->editResultCache = $editResultCache;
54  }
55 
66  public function approveRevertedTagForRevision( int $revertRevisionId ): bool {
67  $editResult = $this->editResultCache->get( $revertRevisionId );
68  if ( $editResult === null ) {
69  return false;
70  }
71 
72  $spec = RevertedTagUpdateJob::newSpec( $revertRevisionId, $editResult );
73  $this->jobQueueGroup->lazyPush( $spec );
74  return true;
75  }
76 }
MediaWiki\Storage\RevertedTagUpdateManager\$jobQueueGroup
JobQueueGroup $jobQueueGroup
Definition: RevertedTagUpdateManager.php:39
RevertedTagUpdateJob\newSpec
static newSpec(int $revertRevisionId, EditResult $editResult)
Returns a JobSpecification for this job.
Definition: RevertedTagUpdateJob.php:48
MediaWiki\Storage\RevertedTagUpdateManager\$editResultCache
EditResultCache $editResultCache
Definition: RevertedTagUpdateManager.php:42
MediaWiki\Storage\RevertedTagUpdateManager\__construct
__construct(EditResultCache $editResultCache, JobQueueGroup $jobQueueGroup)
Definition: RevertedTagUpdateManager.php:48
MediaWiki\Storage\EditResultCache
Class allowing easy storage and retrieval of EditResults associated with revisions.
Definition: EditResultCache.php:42
MediaWiki\Storage
Definition: BlobAccessException.php:23
MediaWiki\Storage\RevertedTagUpdateManager\approveRevertedTagForRevision
approveRevertedTagForRevision(int $revertRevisionId)
Enqueue a RevertedTagUpdateJob for the given revision, if needed.
Definition: RevertedTagUpdateManager.php:66
RevertedTagUpdateJob
Job for deferring the execution of RevertedTagUpdate.
Definition: RevertedTagUpdateJob.php:38
MediaWiki\Storage\RevertedTagUpdateManager
Class for managing delayed RevertedTagUpdateJob waiting for user approval.
Definition: RevertedTagUpdateManager.php:36
JobQueueGroup
Class to handle enqueueing of background jobs.
Definition: JobQueueGroup.php:32