MediaWiki  1.34.0
PreparedEdit.php
Go to the documentation of this file.
1 <?php
21 namespace MediaWiki\Edit;
22 
23 use Content;
24 use ParserOptions;
25 use RuntimeException;
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 }
ParserOptions
Set options of the Parser.
Definition: ParserOptions.php:42
MediaWiki\Edit\PreparedEdit\$pstContent
Content null $pstContent
Content after going through pre-save transform.
Definition: PreparedEdit.php:55
ParserOutput
Definition: ParserOutput.php:25
MediaWiki\Edit\PreparedEdit\$revid
int null $revid
Revision ID.
Definition: PreparedEdit.php:48
MediaWiki\Edit
Definition: PreparedEdit.php:21
MediaWiki\Edit\PreparedEdit\$newContent
Content $newContent
Content that is being saved (before PST)
Definition: PreparedEdit.php:83
MediaWiki\Edit\PreparedEdit\$oldContent
Content null $oldContent
Current content of the page, if any.
Definition: PreparedEdit.php:90
MediaWiki\Edit\PreparedEdit\$parserOutputCallback
callable $parserOutputCallback
Lazy-loading callback to get canonical ParserOutput object.
Definition: PreparedEdit.php:97
MediaWiki\Edit\PreparedEdit\$format
string $format
Content format.
Definition: PreparedEdit.php:62
MediaWiki\Edit\PreparedEdit\__get
__get( $name)
Fetch the ParserOutput via a lazy-loaded callback (for backwards compatibility).
Definition: PreparedEdit.php:117
MediaWiki\Edit\PreparedEdit\$popts
ParserOptions $popts
Parser options used to get parser output.
Definition: PreparedEdit.php:69
MediaWiki\Edit\PreparedEdit\$timestamp
string $timestamp
Time this prepared edit was made.
Definition: PreparedEdit.php:41
MediaWiki\Edit\PreparedEdit\getOutput
getOutput()
Definition: PreparedEdit.php:102
Content
Base interface for content objects.
Definition: Content.php:34
MediaWiki\Edit\PreparedEdit\$canonicalOutput
ParserOutput null $canonicalOutput
Parser output.
Definition: PreparedEdit.php:76
MediaWiki\Edit\PreparedEdit
Represents information returned by WikiPage::prepareContentForEdit()
Definition: PreparedEdit.php:35