MediaWiki master
RevertedTagUpdateManager.php
Go to the documentation of this file.
1<?php
21namespace MediaWiki\Storage;
22
25
36
38 private $jobQueueGroup;
39
41 private $editResultCache;
42
43 public function __construct(
44 EditResultCache $editResultCache,
45 JobQueueGroup $jobQueueGroup
46 ) {
47 $this->jobQueueGroup = $jobQueueGroup;
48 $this->editResultCache = $editResultCache;
49 }
50
61 public function approveRevertedTagForRevision( int $revertRevisionId ): bool {
62 $editResult = $this->editResultCache->get( $revertRevisionId );
63 if ( $editResult === null ) {
64 return false;
65 }
66
67 $spec = RevertedTagUpdateJob::newSpec( $revertRevisionId, $editResult );
68 $this->jobQueueGroup->lazyPush( $spec );
69 return true;
70 }
71}
Handle enqueueing of background jobs.
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)
Job for deferring the execution of RevertedTagUpdate.
static newSpec(int $revertRevisionId, EditResult $editResult)
Returns a JobSpecification for this job.