MediaWiki  master
Page\ProperPageIdentity Interface Reference

Interface for objects representing a page that is (or could be, or used to be) an editable page on a wiki. More...

Inheritance diagram for Page\ProperPageIdentity:
Collaboration diagram for Page\ProperPageIdentity:

Public Member Functions

 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

Interface for objects representing a page that is (or could be, or used to be) an editable page on a wiki.

Note
In contrast to PageIdentity, a ProperPageIdentity is guaranteed to represent an actual editable (or creatable) page. Eventually, PageIdentity is intended to adopt the same contract. At that point, ProperPageIdentity may become an alias for PageIdentity.
For compatibility with the WikiPage class, ProperPageIdentity instances may be mutable, and return different values from methods such as getId() or exist() at different times. In the future, the contract of this interface is intended to be changed to disallow this.
Stability: stable
to type
Since
1.36

Definition at line 43 of file ProperPageIdentity.php.

Member Function Documentation

◆ canExist()

Page\ProperPageIdentity::canExist ( )

Always true.

Implementations must ensure that no "improper" instances can be created.

Returns
true

Implements Page\PageIdentity.

Implemented in WikiPage, and Page\PageIdentityValue.

◆ getDBkey()

Page\ProperPageIdentity::getDBkey ( )

Get the page title in DB key form.

This should always return a valid DB key.

Returns
string

Implements Page\PageReference.

Implemented in WikiPage.

◆ getId()

Page\ProperPageIdentity::getId (   $wikiId = self::LOCAL)

Returns the page ID.

Will return 0 if the page does not currently exist.

Parameters
string | false$wikiIdMust be provided when accessing the ID of a non-local PageIdentity, to prevent data corruption when using a PageIdentity belonging to one wiki in the context of another. Should be omitted if expecting the local wiki.
Exceptions
PreconditionExceptionif this PageIdentity does not belong to the wiki identified by $wikiId.
Returns
int

Implements Page\PageIdentity.

Implemented in WikiPage, and Page\PageIdentityValue.

Referenced by PoolWorkArticleViewCurrent\__construct(), Page\ParserOutputAccess\checkPreconditions(), MediaWiki\Rest\Handler\PageHistoryHandler\getDbResults(), ParserCache\makeMetadataKey(), ParserCache\makeParserOutputKey(), MediaWiki\Rest\Handler\LanguageLinksHandler\run(), MediaWiki\Rest\Handler\MediaLinksHandler\run(), and MediaWiki\Rest\Handler\PageHistoryHandler\run().

◆ getWikiId()

Page\ProperPageIdentity::getWikiId ( )

Get the ID of the wiki this page belongs to.

See also
RevisionRecord::getWikiId()
Returns
string|false The wiki's logical name, of false to indicate the local wiki.

Implements Page\PageReference.

Implemented in WikiPage.


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