MediaWiki 1.42.0
MediaWiki\Page\ProperPageIdentity Interface Reference

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

Inherits MediaWiki\Page\PageIdentity.

Inherited by MediaWiki\Page\PageIdentityValue, and MediaWiki\Page\PageRecord.

Collaboration diagram for MediaWiki\Page\ProperPageIdentity:

Public Member Functions

 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

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

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.
See also
https://www.mediawiki.org/wiki/Manual:Modeling_pages
Stability: stable
to type
Since
1.36

Definition at line 44 of file ProperPageIdentity.php.

Member Function Documentation

◆ canExist()

MediaWiki\Page\ProperPageIdentity::canExist ( )

Always true.

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

Returns
true

Implements MediaWiki\Page\PageIdentity.

Implemented in MediaWiki\Page\PageIdentityValue, and WikiPage.

◆ getDBkey()

MediaWiki\Page\ProperPageIdentity::getDBkey ( )

Get the page title in DB key form.

This should always return a valid DB key.

Returns
string

Implements MediaWiki\Page\PageReference.

Implemented in WikiPage.

◆ getId()

MediaWiki\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 MediaWiki\Page\PageIdentity.

Implemented in MediaWiki\Page\PageIdentityValue, and WikiPage.

Referenced by MediaWiki\PoolCounter\PoolWorkArticleViewCurrent\__construct(), and MediaWiki\Preferences\MultiTitleFilter\filterFromForm().

◆ getWikiId()

MediaWiki\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 MediaWiki\Page\PageReference.

Implemented in WikiPage.


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