Translate extension for MediaWiki
 
Loading...
Searching...
No Matches
PageMoveOperation.php
1<?php
2declare( strict_types = 1 );
3
4namespace MediaWiki\Extension\Translate\PageTranslation;
5
6use Title;
7
16 private $old;
18 private $new;
20 private $oldTalkpage;
22 private $newTalkpage;
24 private $invalidPageTitleRename;
25
26 public function __construct( Title $old, ?Title $new, ?InvalidPageTitleRename $e = null ) {
27 $this->old = $old;
28 $this->new = $new;
29 $this->invalidPageTitleRename = $e;
30 }
31
32 public function getOldTitle(): Title {
33 return $this->old;
34 }
35
36 public function getNewTitle(): ?Title {
37 return $this->new;
38 }
39
40 public function getOldTalkpage(): ?Title {
41 return $this->oldTalkpage;
42 }
43
44 public function getNewTalkpage(): ?Title {
45 return $this->newTalkpage;
46 }
47
48 public function hasTalkpage(): bool {
49 return $this->oldTalkpage !== null;
50 }
51
52 public function getRenameErrorCode(): int {
53 return $this->invalidPageTitleRename ?
54 $this->invalidPageTitleRename->getCode() : PageTitleRenamer::NO_ERROR;
55 }
56
57 public function setTalkpage( Title $oldTalkpage, ?Title $newTalkpage ): void {
58 $this->oldTalkpage = $oldTalkpage;
59 $this->newTalkpage = $newTalkpage;
60 }
61}
Represents a single page being moved including the talk page.