MediaWiki REL1_40
|
RenderedRevision represents the rendered representation of a revision. More...
Inherits MediaWiki\Revision\SlotRenderingProvider.
Public Member Functions | |
__construct (RevisionRecord $revision, ParserOptions $options, ContentRenderer $contentRenderer, callable $combineOutput, $audience=RevisionRecord::FOR_PUBLIC, Authority $performer=null) | |
getOptions () | |
getRevision () | |
getRevisionParserOutput (array $hints=[]) | |
getSlotParserOutput ( $role, array $hints=[]) | |
isContentDeleted () | |
setRevisionParserOutput (ParserOutput $output) | |
Sets a ParserOutput to be returned by getRevisionParserOutput(). | |
setSaveParseLogger (LoggerInterface $saveParseLogger) | |
updateRevision (RevisionRecord $rev) | |
Updates the RevisionRecord after the revision has been saved. | |
RenderedRevision represents the rendered representation of a revision.
It acts as a lazy provider of ParserOutput objects for the revision's individual slots, as well as a combined ParserOutput of all slots.
Definition at line 45 of file RenderedRevision.php.
MediaWiki\Revision\RenderedRevision::__construct | ( | RevisionRecord | $revision, |
ParserOptions | $options, | ||
ContentRenderer | $contentRenderer, | ||
callable | $combineOutput, | ||
$audience = RevisionRecord::FOR_PUBLIC, | |||
Authority | $performer = null ) |
RevisionRecord | $revision | The revision to render. The content for rendering will be taken from this RevisionRecord. However, if the RevisionRecord is not complete according isReadyForInsertion(), but a revision ID is known, the parser may load the revision from the database if it needs revision meta data to handle magic words like {{REVISIONUSER}}. |
ParserOptions | $options | |
ContentRenderer | $contentRenderer | |
callable | $combineOutput | Callback for combining slot output into revision output. Signature: function ( RenderedRevision $this ): ParserOutput. |
int | $audience | Use RevisionRecord::FOR_PUBLIC, FOR_THIS_USER, or RAW. |
Authority | null | $performer | Required if $audience is FOR_THIS_USER. |
Definition at line 109 of file RenderedRevision.php.
References MediaWiki\Revision\RevisionRecord\FOR_THIS_USER.
MediaWiki\Revision\RenderedRevision::getOptions | ( | ) |
Definition at line 159 of file RenderedRevision.php.
MediaWiki\Revision\RenderedRevision::getRevision | ( | ) |
Definition at line 152 of file RenderedRevision.php.
MediaWiki\Revision\RenderedRevision::getRevisionParserOutput | ( | array | $hints = [] | ) |
array | $hints | Hints given as an associative array. Known keys:
|
Definition at line 193 of file RenderedRevision.php.
MediaWiki\Revision\RenderedRevision::getSlotParserOutput | ( | $role, | |
array | $hints = [] ) |
string | $role | |
array | $hints | Hints given as an associative array. Known keys:
|
SuppressedDataException | if the content is not accessible for the audience specified in the constructor. |
Implements MediaWiki\Revision\SlotRenderingProvider.
Definition at line 223 of file RenderedRevision.php.
References $content.
MediaWiki\Revision\RenderedRevision::isContentDeleted | ( | ) |
Definition at line 145 of file RenderedRevision.php.
References MediaWiki\Revision\RevisionRecord\DELETED_TEXT.
MediaWiki\Revision\RenderedRevision::setRevisionParserOutput | ( | ParserOutput | $output | ) |
Sets a ParserOutput to be returned by getRevisionParserOutput().
ParserOutput | $output |
Definition at line 173 of file RenderedRevision.php.
References MediaWiki\Revision\SlotRecord\MAIN.
MediaWiki\Revision\RenderedRevision::setSaveParseLogger | ( | LoggerInterface | $saveParseLogger | ) |
LoggerInterface | $saveParseLogger |
Definition at line 138 of file RenderedRevision.php.
Referenced by MediaWiki\Revision\RevisionRenderer\getRenderedRevision().
MediaWiki\Revision\RenderedRevision::updateRevision | ( | RevisionRecord | $rev | ) |
Updates the RevisionRecord after the revision has been saved.
This can be used to discard and cached ParserOutput so parser functions like {{REVISIONTIMESTAMP}} or {{REVISIONID}} are re-evaluated.
RevisionRecord | $rev |
Definition at line 281 of file RenderedRevision.php.
References MediaWiki\Revision\RevisionRecord\getId(), and MediaWiki\Revision\RevisionRecord\getSlots().