MediaWiki
1.39.10
PreparedEdit.php
Go to the documentation of this file.
1
<?php
21
namespace
MediaWiki\Edit
;
22
23
use
Content
;
24
use
ParserOptions
;
25
use
ParserOutput
;
26
use RuntimeException;
27
35
class
PreparedEdit
{
41
public
$revid
;
42
48
public
$pstContent
;
49
55
public
$format
;
56
62
public
$popts
;
63
69
private
$canonicalOutput;
70
76
public
$newContent
;
77
83
public
$oldContent
;
84
90
public
$parserOutputCallback
;
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
}
MediaWiki\Edit\PreparedEdit
Represents information returned by WikiPage::prepareContentForEdit()
Definition
PreparedEdit.php:35
MediaWiki\Edit\PreparedEdit\$oldContent
Content null $oldContent
Current content of the page, if any.
Definition
PreparedEdit.php:83
MediaWiki\Edit\PreparedEdit\$revid
int null $revid
Revision ID.
Definition
PreparedEdit.php:41
MediaWiki\Edit\PreparedEdit\$popts
ParserOptions $popts
Parser options used to get parser output.
Definition
PreparedEdit.php:62
MediaWiki\Edit\PreparedEdit\__get
__get( $name)
Fetch the ParserOutput via a lazy-loaded callback (for backwards compatibility).
Definition
PreparedEdit.php:110
MediaWiki\Edit\PreparedEdit\$newContent
Content $newContent
Content that is being saved (before PST)
Definition
PreparedEdit.php:76
MediaWiki\Edit\PreparedEdit\getOutput
getOutput()
Definition
PreparedEdit.php:95
MediaWiki\Edit\PreparedEdit\$format
string $format
Content format.
Definition
PreparedEdit.php:55
MediaWiki\Edit\PreparedEdit\$parserOutputCallback
callable $parserOutputCallback
Lazy-loading callback to get canonical ParserOutput object.
Definition
PreparedEdit.php:90
MediaWiki\Edit\PreparedEdit\$pstContent
Content null $pstContent
Content after going through pre-save transform.
Definition
PreparedEdit.php:48
ParserOptions
Set options of the Parser.
Definition
ParserOptions.php:46
ParserOutput
Definition
ParserOutput.php:38
Content
Base interface for content objects.
Definition
Content.php:35
MediaWiki\Edit
Definition
ParsoidOutputStash.php:3
includes
edit
PreparedEdit.php
Generated on Tue Oct 1 2024 01:15:32 for MediaWiki by
1.10.0