MediaWiki
master
LinkTarget.php
Go to the documentation of this file.
1
<?php
21
namespace
MediaWiki\Linker
;
22
23
use Stringable;
24
use Wikimedia\Parsoid\Core\LinkTarget as ParsoidLinkTarget;
25
33
interface
LinkTarget
extends
Stringable, ParsoidLinkTarget {
34
41
public
function
getNamespace
(): int;
42
50
public
function
inNamespace
(
int
$ns ): bool;
51
58
public
function
getFragment
(): string;
59
66
public
function
hasFragment
(): bool;
67
78
public
function
getDBkey
(): string;
79
94
public
function
getText
(): string;
95
106
public
function
createFragmentTarget
(
string
$fragment );
107
114
public
function
isExternal
(): bool;
115
122
public
function
getInterwiki
(): string;
123
134
public
function
isSameLinkAs
( ParsoidLinkTarget $other ): bool;
135
142
public
function
__toString
(): string;
143
144
}
MediaWiki\Linker\LinkTarget
Represents the target of a wiki link.
Definition
LinkTarget.php:33
MediaWiki\Linker\LinkTarget\inNamespace
inNamespace(int $ns)
Convenience function to check if the target is in a given namespace.
MediaWiki\Linker\LinkTarget\getInterwiki
getInterwiki()
The interwiki component of this LinkTarget.
MediaWiki\Linker\LinkTarget\hasFragment
hasFragment()
Whether the link target has a fragment.
MediaWiki\Linker\LinkTarget\__toString
__toString()
Return an informative human-readable representation of the link target, for use in logging and debugg...
MediaWiki\Linker\LinkTarget\getFragment
getFragment()
Get the link fragment in text form (i.e.
MediaWiki\Linker\LinkTarget\getNamespace
getNamespace()
Get the namespace index.
MediaWiki\Linker\LinkTarget\getDBkey
getDBkey()
Get the main part of the link target, in canonical database form.
MediaWiki\Linker\LinkTarget\isSameLinkAs
isSameLinkAs(ParsoidLinkTarget $other)
Check whether the given LinkTarget refers to the same target as this LinkTarget.
MediaWiki\Linker\LinkTarget\isExternal
isExternal()
Whether this LinkTarget has an interwiki component.
MediaWiki\Linker\LinkTarget\getText
getText()
Get the main part of the link target, in text form.
MediaWiki\Linker\LinkTarget\createFragmentTarget
createFragmentTarget(string $fragment)
Create a new LinkTarget with a different fragment on the same page.
MediaWiki\Linker
includes
linker
LinkTarget.php
Generated on Sat Dec 21 2024 11:24:43 for MediaWiki by
1.10.0