MediaWiki 1.42.1
MediaWiki\Page\PageRecord Interface Reference

Data record representing a page that is (or used to be, or could be) an editable page on a wiki. More...

Inherits MediaWiki\Page\ProperPageIdentity.

Inherited by MediaWiki\Page\ExistingPageRecord, and WikiPage.

Collaboration diagram for MediaWiki\Page\PageRecord:

Public Member Functions

 getLanguage ()
 The page's language, if explicitly recorded.
 
 getLatest ( $wikiId=self::LOCAL)
 The ID of the page's latest revision.
 
 getTouched ()
 Timestamp at which the page was last flagged for rerendering.
 
 isNew ()
 False if the page has had more than one edit.
 
 isRedirect ()
 True if the page is a redirect.
 
- Public Member Functions inherited from MediaWiki\Page\ProperPageIdentity
 canExist ()
 Always true.
 
 getDBkey ()
 Get the page title in DB key form.
 
 getId ( $wikiId=self::LOCAL)
 Returns the page ID.
 
 getWikiId ()
 Get the ID of the wiki this page belongs to.
 
- Public Member Functions inherited from MediaWiki\Page\PageIdentity
 exists ()
 Checks if the page currently exists.
 
- Public Member Functions inherited from MediaWiki\Page\PageReference
 __toString ()
 Returns an informative human readable unique representation of the page identity, for use as a cache key and for logging and debugging.
 
 getNamespace ()
 Returns the page's namespace number.
 
 isSamePageAs (PageReference $other)
 Checks whether the given PageReference refers to the same page as this PageReference.
 
- Public Member Functions inherited from MediaWiki\DAO\WikiAwareEntity
 assertWiki ( $wikiId)
 Throws if $wikiId is different from the return value of getWikiId().
 

Detailed Description

Data record representing a page that is (or used to be, or could be) an editable page on a wiki.

For compatibility with the WikiPage class, PageIdentity instances may represent non-existing pages. In the future, the contract of this interface is intended to be changed to disallow this. PageIdentity instances may also be mutable, and return different values from methods such as getLatest() or isRedirect() at different times. In the future, the contract of this interface is intended to be changed to disallow this.

Only WikiPage should implement PageRecord directly, other implementations should use ExistingPageRecord instead. Once WikiPage is removed or guaranteed to be immutable and existing, ExistingPageRecord will become an alias of PageRecord.

See also
https://www.mediawiki.org/wiki/Manual:Modeling_pages
Stability: stable
to type
Since
1.36

Definition at line 26 of file PageRecord.php.

Member Function Documentation

◆ getLanguage()

MediaWiki\Page\PageRecord::getLanguage ( )

The page's language, if explicitly recorded.

The effective page language needs to be determined programmatically.

Returns
?string

Implemented in MediaWiki\Page\PageStoreRecord, and WikiPage.

◆ getLatest()

MediaWiki\Page\PageRecord::getLatest ( $wikiId = self::LOCAL)

The ID of the page's latest revision.

Parameters
string | false$wikiIdMust be provided when accessing the ID of the latest revision of a non-local PageRecord, to prevent data corruption when using a PageRecord belonging to one wiki in the context of another. Should be omitted if expecting the local wiki.
Returns
int The revision ID of the page's latest revision, or 0 if the page does not exist.

Implemented in MediaWiki\Page\PageStoreRecord, and WikiPage.

Referenced by ParserCache\save().

◆ getTouched()

MediaWiki\Page\PageRecord::getTouched ( )

Timestamp at which the page was last flagged for rerendering.

Returns
string

Implemented in MediaWiki\Page\PageStoreRecord, and WikiPage.

◆ isNew()

MediaWiki\Page\PageRecord::isNew ( )

False if the page has had more than one edit.

Warning
this is not guaranteed to always return true for old pages that have only one edit.
Returns
bool

Implemented in MediaWiki\Page\PageStoreRecord, and WikiPage.

◆ isRedirect()

MediaWiki\Page\PageRecord::isRedirect ( )

True if the page is a redirect.

Returns
bool

Implemented in MediaWiki\Page\PageStoreRecord, WikiFilePage, and WikiPage.

Referenced by ParserCache\get().


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