MediaWiki  master
PreparedEdit.php
Go to the documentation of this file.
1 <?php
21 namespace MediaWiki\Edit;
22 
23 use Content;
24 use ParserOptions;
26 use ParserOutput;
27 
35 class PreparedEdit {
41  public $timestamp;
42 
48  public $revid;
49 
55  public $pstContent;
56 
62  public $format;
63 
69  public $popts;
70 
77 
83  public $newContent;
84 
90  public $oldContent;
91 
98 
102  public function getOutput() {
103  if ( !$this->canonicalOutput ) {
104  $this->canonicalOutput = call_user_func( $this->parserOutputCallback );
105  }
106 
107  return $this->canonicalOutput;
108  }
109 
117  function __get( $name ) {
118  if ( $name === 'output' ) {
119  return $this->getOutput();
120  }
121 
122  throw new RuntimeException( "Undefined field $name." );
123  }
124 }
Content null $oldContent
Current content of the page, if any.
Content null $pstContent
Content after going through pre-save transform.
Represents information returned by WikiPage::prepareContentForEdit()
Content $newContent
Content that is being saved (before PST)
ParserOptions $popts
Parser options used to get parser output.
callable $parserOutputCallback
Lazy-loading callback to get canonical ParserOutput object.
string $format
Content format.
int null $revid
Revision ID.
__get( $name)
Fetch the ParserOutput via a lazy-loaded callback (for backwards compatibility).
ParserOutput null $canonicalOutput
Parser output.
string $timestamp
Time this prepared edit was made.