MediaWiki master
PreparedEdit.php
Go to the documentation of this file.
1<?php
7namespace MediaWiki\Edit;
8
12use RuntimeException;
13
27 public $revid;
28
35
41 public $format;
42
48 public $popts;
49
55 private $canonicalOutput;
56
63
70
77
81 public function getOutput() {
82 if ( !$this->canonicalOutput ) {
83 $this->canonicalOutput = ( $this->parserOutputCallback )();
84 }
85
86 return $this->canonicalOutput;
87 }
88
96 public function __get( $name ) {
97 if ( $name === 'output' ) {
98 return $this->getOutput();
99 } elseif ( $name === 'timestamp' ) {
100 return $this->getOutput()->getCacheTime();
101 }
102
103 throw new RuntimeException( "Undefined field $name." );
104 }
105}
Represents information returned by WikiPage::prepareContentForEdit()
Content null $oldContent
Current content of the page, if any.
int null $revid
Revision ID.
ParserOptions $popts
Parser options used to get parser output.
__get( $name)
Fetch the ParserOutput via a lazy-loaded callback (for backwards compatibility).
Content $newContent
Content that is being saved (before PST)
string $format
Content format.
callable $parserOutputCallback
Lazy-loading callback to get canonical ParserOutput object.
Content null $pstContent
Content after going through pre-save transform.
Set options of the Parser.
ParserOutput is a rendering of a Content object or a message.
Content objects represent page content, e.g.
Definition Content.php:28