MediaWiki REL1_39
|
Public Member Functions | |
__toString () | |
Return an informative human-readable representation of the link target, for use in logging and debugging. | |
createFragmentTarget (string $fragment) | |
Create a new LinkTarget with a different fragment on the same page. | |
getDBkey () | |
Get the main part of the link target, in canonical database form. | |
getFragment () | |
Get the link fragment in text form (i.e. | |
getInterwiki () | |
The interwiki component of this LinkTarget. | |
getNamespace () | |
Get the namespace index. | |
getText () | |
Get the main part of the link target, in text form. | |
hasFragment () | |
Whether the link target has a fragment. | |
inNamespace (int $ns) | |
Convenience function to check if the target is in a given namespace. | |
isExternal () | |
Whether this LinkTarget has an interwiki component. | |
isSameLinkAs (LinkTarget $other) | |
Check whether the given LinkTarget refers to the same target as this LinkTarget. | |
Definition at line 26 of file LinkTarget.php.
MediaWiki\Linker\LinkTarget::__toString | ( | ) |
Return an informative human-readable representation of the link target, for use in logging and debugging.
Implemented in Title, and TitleValue.
MediaWiki\Linker\LinkTarget::createFragmentTarget | ( | string | $fragment | ) |
Create a new LinkTarget with a different fragment on the same page.
It is expected that the same type of object will be returned, but the only requirement is that it is a LinkTarget.
string | $fragment | The fragment override, or "" to remove it. |
Implemented in Title, and TitleValue.
MediaWiki\Linker\LinkTarget::getDBkey | ( | ) |
Get the main part of the link target, in canonical database form.
The main part is the link target without namespace prefix or hash fragment. The database form means that spaces become underscores, this is also used for URLs.
Implemented in Title, and TitleValue.
Referenced by Parser\fetchFileAndTitle(), WikiPage\insertRedirectEntry(), LanguageConverter\updateConversionTable(), and MessageCache\updateMessageOverride().
MediaWiki\Linker\LinkTarget::getFragment | ( | ) |
Get the link fragment in text form (i.e.
the bit after the hash #
).
Implemented in Title, and TitleValue.
Referenced by WikiPage\insertRedirectEntry(), and Title\newFromLinkTarget().
MediaWiki\Linker\LinkTarget::getInterwiki | ( | ) |
The interwiki component of this LinkTarget.
Implemented in Title, and TitleValue.
Referenced by NamespaceInfo\canHaveTalkPage(), WikiPage\insertRedirectEntry(), and Title\newFromLinkTarget().
MediaWiki\Linker\LinkTarget::getNamespace | ( | ) |
Get the namespace index.
Implemented in Title, and TitleValue.
Referenced by NamespaceInfo\canHaveTalkPage(), WikiPage\insertRedirectEntry(), Title\newFromLinkTarget(), and LanguageConverter\updateConversionTable().
MediaWiki\Linker\LinkTarget::getText | ( | ) |
Get the main part of the link target, in text form.
The main part is the link target without namespace prefix or hash fragment. The text form is used for display purposes.
This is computed from the DB key by replacing any underscores with spaces.
Implemented in Title, and TitleValue.
Referenced by NamespaceInfo\canHaveTalkPage(), Parser\makeImage(), and Title\newFromLinkTarget().
MediaWiki\Linker\LinkTarget::hasFragment | ( | ) |
MediaWiki\Linker\LinkTarget::inNamespace | ( | int | $ns | ) |
Convenience function to check if the target is in a given namespace.
int | $ns |
Implemented in Title, and TitleValue.
MediaWiki\Linker\LinkTarget::isExternal | ( | ) |
Whether this LinkTarget has an interwiki component.
Implemented in Title, and TitleValue.
Referenced by LinkBatch\addObj().
MediaWiki\Linker\LinkTarget::isSameLinkAs | ( | LinkTarget | $other | ) |
Check whether the given LinkTarget refers to the same target as this LinkTarget.
Two link targets are considered the same if they have the same interwiki prefix, are in the same namespace, have the same main part, and the same fragment.
LinkTarget | $other |
Implemented in Title, and TitleValue.
Referenced by Parser\fetchFileAndTitle().