MediaWiki master
PreparedEdit.php
Go to the documentation of this file.
1<?php
21namespace MediaWiki\Edit;
22
23use Content;
26use RuntimeException;
27
41 public $revid;
42
49
55 public $format;
56
62 public $popts;
63
69 private $canonicalOutput;
70
77
84
91
95 public function getOutput() {
96 if ( !$this->canonicalOutput ) {
97 $this->canonicalOutput = call_user_func( $this->parserOutputCallback );
98 }
99
100 return $this->canonicalOutput;
101 }
102
110 public function __get( $name ) {
111 if ( $name === 'output' ) {
112 return $this->getOutput();
113 } elseif ( $name === 'timestamp' ) {
114 return $this->getOutput()->getCacheTime();
115 }
116
117 throw new RuntimeException( "Undefined field $name." );
118 }
119}
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.
Rendered output of a wiki page, as parsed from wikitext.
Set options of the Parser.
Base interface for representing page content.
Definition Content.php:37