19 private string $logType;
20 private Title $baseSourceTitle;
22 public function __construct( Title $baseSourceTitle,
string $logType ) {
23 $this->baseSourceTitle = $baseSourceTitle;
24 $this->logType = $logType;
27 public function logSuccess( User $performer, Title $target,
string $reason ):
void {
28 $entry =
new ManualLogEntry( $this->logType,
'moveok' );
29 $entry->setPerformer( $performer );
30 $entry->setTarget( $this->baseSourceTitle );
31 $entry->setComment( $reason );
32 $entry->setParameters( [
'target' => $target->getPrefixedText() ] );
33 $logid = $entry->insert();
34 $entry->publish( $logid );
37 public function logError( User $performer, Title $source, Title $target, Status $error ):
void {
38 $entry =
new ManualLogEntry( $this->logType,
'movenok' );
39 $entry->setPerformer( $performer );
40 $entry->setTarget( $source );
41 $entry->setParameters( [
42 'target' => $target->getPrefixedText(),
43 'error' => $error->getErrorsArray(),
45 $logid = $entry->insert();
46 $entry->publish( $logid );