MediaWiki master
RevertedTagUpdateManager.php
Go to the documentation of this file.
1<?php
7namespace MediaWiki\Storage;
8
11
22
23 public function __construct(
24 private readonly EditResultCache $editResultCache,
25 private readonly JobQueueGroup $jobQueueGroup,
26 ) {
27 }
28
39 public function approveRevertedTagForRevision( int $revertRevisionId ): bool {
40 $editResult = $this->editResultCache->get( $revertRevisionId );
41 if ( $editResult === null || !$editResult->isRevert() ) {
42 return false;
43 }
44
45 $spec = RevertedTagUpdateJob::newSpec( $revertRevisionId, $editResult );
46 $this->jobQueueGroup->lazyPush( $spec );
47 return true;
48 }
49}
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(private readonly EditResultCache $editResultCache, private readonly JobQueueGroup $jobQueueGroup,)