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
47 public function __construct(
48 EditResultCache $editResultCache,
49 JobQueueGroup $jobQueueGroup
50 ) {
51 $this->jobQueueGroup = $jobQueueGroup;
52 $this->editResultCache = $editResultCache;
53 }
54
65 public function approveRevertedTagForRevision( int $revertRevisionId ): bool {
66 $editResult = $this->editResultCache->get( $revertRevisionId );
67 if ( $editResult === null ) {
68 return false;
69 }
70
71 $spec = RevertedTagUpdateJob::newSpec( $revertRevisionId, $editResult );
72 $this->jobQueueGroup->lazyPush( $spec );
73 return true;
74 }
75}
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.