MediaWiki REL1_33
MediaWiki\Linker\LinkTarget Interface Reference
Inheritance diagram for MediaWiki\Linker\LinkTarget:

Public Member Functions

 __toString ()
 Returns an informative human readable representation of the link target, for use in logging and debugging.
 
 createFragmentTarget ( $fragment)
 Creates a new LinkTarget for a different fragment of the same page.
 
 getDBkey ()
 Get the main part with underscores.
 
 getFragment ()
 Get the link fragment (i.e.
 
 getInterwiki ()
 The interwiki component of this LinkTarget.
 
 getNamespace ()
 Get the namespace index.
 
 getText ()
 Returns the link in text form, without namespace prefix or fragment.
 
 hasFragment ()
 Whether the link target has a fragment.
 
 inNamespace ( $ns)
 Convenience function to test if it is in the namespace.
 
 isExternal ()
 Whether this LinkTarget has an interwiki component.
 

Detailed Description

Since
1.27

Definition at line 26 of file LinkTarget.php.

Member Function Documentation

◆ __toString()

MediaWiki\Linker\LinkTarget::__toString ( )

Returns an informative human readable representation of the link target, for use in logging and debugging.

There is no requirement for the return value to have any relationship with the input of TitleParser.

Since
1.31
Returns
string

Implemented in Title, and TitleValue.

◆ createFragmentTarget()

MediaWiki\Linker\LinkTarget::createFragmentTarget (   $fragment)

Creates a new LinkTarget for a different fragment of 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.

Since
1.27
Parameters
string$fragmentThe fragment name, or "" for the entire page.
Returns
LinkTarget

Implemented in Title, and TitleValue.

Referenced by MediaWiki\Linker\LinkRenderer\makeBrokenLink().

◆ getDBkey()

◆ getFragment()

MediaWiki\Linker\LinkTarget::getFragment ( )

Get the link fragment (i.e.

the bit after the #) in text form.

Since
1.27
Returns
string link fragment

Implemented in Title, and TitleValue.

Referenced by MediaWiki\Tests\Revision\RevisionStoreDbTestBase\assertLinkTargetsEqual(), MediaWiki\Linker\LinkRenderer\getLinkText(), Linker\makeCommentLink(), Title\newFromLinkTarget(), and Linker\normaliseSpecialPage().

◆ getInterwiki()

MediaWiki\Linker\LinkTarget::getInterwiki ( )

The interwiki component of this LinkTarget.

Since
1.27
Returns
string

Implemented in Title, and TitleValue.

Referenced by MediaWiki\Tests\Revision\RevisionStoreDbTestBase\assertLinkTargetsEqual(), MediaWikiTitleCodec\getPrefixedDBkey(), and Title\newFromLinkTarget().

◆ getNamespace()

MediaWiki\Linker\LinkTarget::getNamespace ( )

Get the namespace index.

Since
1.27
Returns
int Namespace index

Implemented in Title, and TitleValue.

Referenced by OutputPage\addContentOverride(), LinkCache\addLinkObj(), MediaWiki\Tests\Revision\RevisionStoreDbTestBase\assertLinkTargetsEqual(), MediaWiki\Permissions\PermissionManager\checkActionPermissions(), MediaWiki\Permissions\PermissionManager\checkQuickPermissions(), MediaWiki\Permissions\PermissionManager\checkReadPermissions(), MediaWiki\Permissions\PermissionManager\checkSpecialsAndNSPermissions(), Title\compare(), WatchedItemStore\countVisitingWatchers(), WatchedItemStore\countWatchers(), WatchedItemStore\dbCond(), WatchedItemStore\duplicateEntry(), LinkCache\fetchPageRow(), NamespaceDupes\getAlternateTitle(), WatchedItemStore\getCacheKey(), MediaWiki\Revision\MainSlotRoleHandler\getDefaultModel(), WatchedItemQueryService\getFromUntilTargetConds(), MediaWikiTitleCodec\getFullText(), MediaWiki\Linker\LinkRenderer\getLinkClasses(), MediaWikiTitleCodec\getPrefixedDBkey(), MediaWikiTitleCodec\getPrefixedText(), ApiQueryInfo\getVisitingWatcherInfo(), MediaWiki\Permissions\PermissionManager\isSameSpecialPage(), MediaWiki\Linker\LinkRenderer\makeBrokenLink(), Linker\makeCommentLink(), NamespaceDupes\movePage(), Title\newFromLinkTarget(), Linker\normaliseSpecialPage(), WatchedItemStoreUnitTest\testDuplicateAllAssociatedEntries_somethingToDuplicate(), WatchedItemStore\uncache(), WatchedItemStore\uncacheLinkTarget(), WatchedItemStore\updateNotificationTimestamp(), and WatchedItemStoreUnitTest\verifyCallbackJob().

◆ getText()

MediaWiki\Linker\LinkTarget::getText ( )

Returns the link in text form, without namespace prefix or fragment.

This is computed from the DB key by replacing any underscores with spaces.

Since
1.27
Returns
string

Implemented in Title, and TitleValue.

Referenced by MediaWiki\Permissions\PermissionManager\checkQuickPermissions(), MediaWiki\Permissions\PermissionManager\checkUserConfigPermissions(), Title\compare(), and Title\newFromLinkTarget().

◆ hasFragment()

MediaWiki\Linker\LinkTarget::hasFragment ( )

Whether the link target has a fragment.

Since
1.27
Returns
bool

Implemented in Title, and TitleValue.

Referenced by MediaWiki\Linker\LinkRenderer\getLinkText(), and MediaWiki\Linker\LinkRenderer\makeBrokenLink().

◆ inNamespace()

MediaWiki\Linker\LinkTarget::inNamespace (   $ns)

Convenience function to test if it is in the namespace.

Since
1.27
Parameters
int$ns
Returns
bool

Implemented in Title, and TitleValue.

Referenced by LinkCache\addLinkObj().

◆ isExternal()

MediaWiki\Linker\LinkTarget::isExternal ( )

Whether this LinkTarget has an interwiki component.

Since
1.27
Returns
bool

Implemented in Title, and TitleValue.

Referenced by LinkCache\addLinkObj(), Linker\makeCommentLink(), MediaWiki\Linker\LinkRenderer\makeKnownLink(), and Linker\normaliseSpecialPage().


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