page = $page; $this->updates = $updates; $this->causeAction = $options['causeAction'] ?? 'unknown'; $this->causeAgent = $options['causeAgent'] ?? 'unknown'; $this->recursive = !empty( $options['recursive'] ); $this->cacheTimestamp = $cacheTime; $this->domain = $domain; } public function doUpdate() { foreach ( $this->updates as $update ) { $update->doUpdate(); } } /** * Set the revision corresponding to this LinksUpdate * @param Revision $revision */ public function setRevision( Revision $revision ) { $this->revision = $revision; } /** * Set the User who triggered this LinksUpdate * @param User $user */ public function setTriggeringUser( User $user ) { $this->user = $user; } public function getAsJobSpecification() { return [ 'wiki' => WikiMap::getWikiIdFromDomain( $this->domain ), 'job' => new JobSpecification( 'refreshLinksPrioritized', [ // Reuse the parser cache if it was saved 'rootJobTimestamp' => $this->cacheTimestamp, 'useRecursiveLinksUpdate' => $this->recursive, 'triggeringUser' => $this->user ? [ 'userId' => $this->user->getId(), 'userName' => $this->user->getName() ] : false, 'triggeringRevisionId' => $this->revision ? $this->revision->getId() : false, 'causeAction' => $this->getCauseAction(), 'causeAgent' => $this->getCauseAgent() ], [ 'removeDuplicates' => true ], $this->page->getTitle() ) ]; } }