MediaWiki REL1_39
MediaWiki\Storage\PreparedUpdate Interface Reference

An object representing a page update during an edit. More...

Inheritance diagram for MediaWiki\Storage\PreparedUpdate:

Public Member Functions

 getCanonicalParserOutput ()
 Returns the canonical parser output.
 
 getModifiedSlotRoles ()
 Returns the role names of the slots added or updated by the new revision.
 
 getPage ()
 Returns the identity of the page being updated.
 
 getParserOutputForMetaData ()
 Returns the canonical parser output without requiring rendering.
 
 getRawContent (string $role)
 Returns the content of the given slot, with no audience checks.
 
 getRemovedSlotRoles ()
 Returns the role names of the slots removed by the new revision.
 
 getRenderedRevision ()
 Returns a RenderedRevision instance acting as a lazy holder for the ParserOutput of the revision.
 
 getRevision ()
 Returns the update's target revision - that is, the revision that will be the current revision after the update.
 
 isCountable ()
 Whether the page will be countable after the edit.
 
 isRedirect ()
 Whether the page will be a redirect after the edit.
 

Detailed Description

An object representing a page update during an edit.

Instances of PreparedUpdate may be passed to hook handlers to provide them with access to the rendered version of a revision that is about to be saved, or has just been saved.

MCR migration note: this replaces PreparedEdit

Since
1.38

Definition at line 22 of file PreparedUpdate.php.

Member Function Documentation

◆ getCanonicalParserOutput()

MediaWiki\Storage\PreparedUpdate::getCanonicalParserOutput ( )

Returns the canonical parser output.

Code that does not need access to the rendered HTML should use getParserOutputForMetaData() instead.

Returns
ParserOutput

Implemented in MediaWiki\Storage\DerivedPageDataUpdater.

◆ getModifiedSlotRoles()

MediaWiki\Storage\PreparedUpdate::getModifiedSlotRoles ( )

Returns the role names of the slots added or updated by the new revision.

Does not include the role names of slots that are being removed.

See also
RevisionSlotsUpdate::getModifiedRoles
Returns
string[]

Implemented in MediaWiki\Storage\DerivedPageDataUpdater.

◆ getPage()

MediaWiki\Storage\PreparedUpdate::getPage ( )

Returns the identity of the page being updated.

Returns
PageIdentity

Implemented in MediaWiki\Storage\DerivedPageDataUpdater.

◆ getParserOutputForMetaData()

MediaWiki\Storage\PreparedUpdate::getParserOutputForMetaData ( )

Returns the canonical parser output without requiring rendering.

It may not be safe to call getText() on the resulting ParserOutput.

Code that does not need to the rendered HTML should prefer this method over getCanonicalParserOutput() since it will be significantly faster for some types of content. This would typically be the case for structured data, for which extracting data is simple, but rendering may require loading additional data.

Returns
ParserOutput

Implemented in MediaWiki\Storage\DerivedPageDataUpdater.

◆ getRawContent()

MediaWiki\Storage\PreparedUpdate::getRawContent ( string $role)

Returns the content of the given slot, with no audience checks.

Parameters
string$roleslot role name
Returns
Content
Exceptions
PageUpdateExceptionIf the slot is neither set for update nor inherited from the parent revision.

Implemented in MediaWiki\Storage\DerivedPageDataUpdater.

◆ getRemovedSlotRoles()

MediaWiki\Storage\PreparedUpdate::getRemovedSlotRoles ( )

Returns the role names of the slots removed by the new revision.

Returns
string[]

Implemented in MediaWiki\Storage\DerivedPageDataUpdater.

◆ getRenderedRevision()

MediaWiki\Storage\PreparedUpdate::getRenderedRevision ( )

Returns a RenderedRevision instance acting as a lazy holder for the ParserOutput of the revision.

Returns
RenderedRevision

Implemented in MediaWiki\Storage\DerivedPageDataUpdater.

◆ getRevision()

MediaWiki\Storage\PreparedUpdate::getRevision ( )

Returns the update's target revision - that is, the revision that will be the current revision after the update.

Returns
RevisionRecord

Implemented in MediaWiki\Storage\DerivedPageDataUpdater.

◆ isCountable()

MediaWiki\Storage\PreparedUpdate::isCountable ( )

Whether the page will be countable after the edit.

Returns
bool

Implemented in MediaWiki\Storage\DerivedPageDataUpdater.

◆ isRedirect()

MediaWiki\Storage\PreparedUpdate::isRedirect ( )

Whether the page will be a redirect after the edit.

Returns
bool

Implemented in MediaWiki\Storage\DerivedPageDataUpdater.


The documentation for this interface was generated from the following file: