MediaWiki master
|
Interface for objects (potentially) representing an editable wiki page. More...
Inherits MediaWiki\Page\PageReference.
Inherited by MediaWiki\Page\ProperPageIdentity, and MediaWiki\Title\Title.
Public Member Functions | |
canExist () | |
Checks whether this PageIdentity represents a "proper" page, meaning that it could exist as an editable page on the wiki. | |
exists () | |
Checks if the page currently exists. | |
getId ( $wikiId=self::LOCAL) | |
Returns the page ID. | |
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. | |
getDBkey () | |
Get the page title in DB key form. | |
getNamespace () | |
Returns the page's namespace number. | |
getWikiId () | |
Get the ID of the wiki this page belongs to. | |
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(). | |
Interface for objects (potentially) representing an editable wiki page.
The identity of any PageIdentity object is defined by the namespace, the dbkey, and the wiki ID. The page ID together with the wiki ID also identifies the page, unless the page ID is 0. If the wiki ID is self::LOCAL, the identity is relative to the local wiki.
Definition at line 67 of file PageIdentity.php.
MediaWiki\Page\PageIdentity::canExist | ( | ) |
Checks whether this PageIdentity represents a "proper" page, meaning that it could exist as an editable page on the wiki.
Implemented in MediaWiki\Page\PageIdentityValue, MediaWiki\Page\ProperPageIdentity, WikiPage, and MediaWiki\Title\Title.
Referenced by RefreshLinksJob\__construct(), and RecentChange\newLogEntry().
MediaWiki\Page\PageIdentity::exists | ( | ) |
Checks if the page currently exists.
Implementations must ensure that this method returns false when getId() would throw or return 0. This also implies that this method must return false if canExist() would return false.
Implemented in MediaWiki\Page\ExistingPageRecord, MediaWiki\Page\PageIdentityValue, and WikiPage.
Referenced by MediaWiki\Deferred\LinksUpdate\LinksDeletionUpdate\__construct(), MediaWiki\Storage\PageUpdatedEvent\__construct(), MediaWiki\Rest\Handler\SearchHandler\execute(), MediaWiki\Language\LanguageConverter\findVariantLink(), MediaWiki\Parser\ParserCache\get(), and MediaWiki\Api\getWatchlistValue().
MediaWiki\Page\PageIdentity::getId | ( | $wikiId = self::LOCAL | ) |
Returns the page ID.
If this ID is 0, this means the page does not exist.
Implementations must call assertWiki().
string | false | $wikiId | Must 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. |
RuntimeException | if this PageIdentity is not a "proper" page identity, but e.g. a relative section link, an interwiki link, etc. |
PreconditionException | if this PageIdentity does not belong to the wiki identified by $wikiId. |
Implemented in MediaWiki\Page\PageIdentityValue, MediaWiki\Page\ProperPageIdentity, WikiPage, and MediaWiki\Title\Title.
Referenced by MediaWiki\Pager\MergeHistoryPager\__construct(), MediaWiki\Deferred\LinksUpdate\LinksDeletionUpdate\__construct(), RecentChange\newForCategorization(), CategoryMembershipChangeJob\newSpec(), and MediaWiki\Page\RedirectStore\updateRedirectTarget().