MediaWiki REL1_39
RevertedTagUpdateManager.php
Go to the documentation of this file.
1<?php
23namespace MediaWiki\Storage;
24
27
37
39 private $jobQueueGroup;
40
42 private $editResultCache;
43
48 public function __construct(
49 EditResultCache $editResultCache,
50 JobQueueGroup $jobQueueGroup
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}
Class to 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.