MediaWiki  master
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...

Inheritance diagram for Page\PageRecord:
Collaboration diagram for Page\PageRecord:

Public Member Functions

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

Detailed Description

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

Note
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.
For compatibility with the WikiPage class, PageIdentity instances may 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.
Stability: stable
to type
Since
1.36

Definition at line 25 of file PageRecord.php.

Member Function Documentation

◆ getLanguage()

Page\PageRecord::getLanguage ( )

The page's language, if explicitly recorded.

The effective page language needs to be determined programmatically.

Returns
?string

Implemented in WikiPage, and Page\PageStoreRecord.

◆ getLatest()

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 WikiPage, and Page\PageStoreRecord.

Referenced by ParserCache\checkOutdated(), MediaWiki\Rest\Handler\LanguageLinksHandler\getETag(), MediaWiki\Rest\Handler\MediaLinksHandler\getETag(), MediaWiki\Rest\Handler\PageHistoryHandler\getETag(), Page\ParserOutputAccess\getParserOutput(), ParserCache\save(), and Page\ParserOutputAccess\shouldUseCache().

◆ getTouched()

◆ isNew()

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 WikiPage, and Page\PageStoreRecord.

◆ isRedirect()

Page\PageRecord::isRedirect ( )

True if the page is a redirect.

Returns
bool

Implemented in WikiPage, WikiFilePage, and Page\PageStoreRecord.

Referenced by ParserCache\get().


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