MediaWiki REL1_40
|
Immutable value object representing a page reference. More...
Inherits MediaWiki\Page\PageReference.
Inherited by MediaWiki\Page\PageIdentityValue.
Public Member Functions | |
__construct (int $namespace, string $dbKey, $wikiId) | |
__toString () | |
Returns a string representation of the title, for logging. | |
getDBkey () | |
Get the page title in DB key form.
| |
getNamespace () | |
Returns the page's namespace number.The value returned by this method should represent a valid namespace, but this cannot be guaranteed in all cases.
| |
getWikiId () | |
Get the ID of the wiki provided to the constructor. | |
isSamePageAs (PageReference $other) | |
Public Member Functions inherited from MediaWiki\DAO\WikiAwareEntity | |
assertWiki ( $wikiId) | |
Throws if $wikiId is different from the return value of getWikiId(). | |
Static Public Member Functions | |
static | localReference (int $namespace, string $dbKey) |
Create PageReference for a local page. | |
Immutable value object representing a page reference.
Instances of this class are expected to always represent a viewable pages, that is, pages that can at least potentially be visited on the wiki. This class may represent Special pages, but not interwiki links, section links, etc.
Code that deserializes instances of PageReferenceValue must ensure that the original meaning of the "local" Wiki ID is preserved: When an instance of PageReferenceValue is created with self::LOCAL as the Wiki ID on one wiki, gets serialized, stored, and later read and unserialized on another wiki, the value of the Wiki ID must be adjusted to refer to the original wiki.
Definition at line 42 of file PageReferenceValue.php.
MediaWiki\Page\PageReferenceValue::__construct | ( | int | $namespace, |
string | $dbKey, | ||
$wikiId ) |
int | $namespace | A valid namespace ID. Validation is the caller's responsibility! |
string | $dbKey | A valid DB key. Validation is the caller's responsibility! |
string | false | $wikiId | The Id of the wiki this page belongs to, or self::LOCAL for the local wiki. |
Definition at line 63 of file PageReferenceValue.php.
MediaWiki\Page\PageReferenceValue::__toString | ( | ) |
Returns a string representation of the title, for logging.
This is purely informative and must not be used programmatically.
Implements MediaWiki\Page\PageReference.
Definition at line 141 of file PageReferenceValue.php.
MediaWiki\Page\PageReferenceValue::getDBkey | ( | ) |
Get the page title in DB key form.
Implements MediaWiki\Page\PageReference.
Definition at line 110 of file PageReferenceValue.php.
MediaWiki\Page\PageReferenceValue::getNamespace | ( | ) |
Returns the page's namespace number.The value returned by this method should represent a valid namespace, but this cannot be guaranteed in all cases.
Implements MediaWiki\Page\PageReference.
Definition at line 101 of file PageReferenceValue.php.
MediaWiki\Page\PageReferenceValue::getWikiId | ( | ) |
Get the ID of the wiki provided to the constructor.
Implements MediaWiki\Page\PageReference.
Definition at line 92 of file PageReferenceValue.php.
MediaWiki\Page\PageReferenceValue::isSamePageAs | ( | PageReference | $other | ) |
PageReference | $other |
Implements MediaWiki\Page\PageReference.
Definition at line 119 of file PageReferenceValue.php.
|
static |
Create PageReference for a local page.
int | $namespace | |
string | $dbKey |
Definition at line 83 of file PageReferenceValue.php.