73 $this->namespaceInfo->exists( $foreignNs )
75 return $this->titleFactory->makeTitleSafe( $foreignNs, $foreignTitle->
getText() );
81 $targetNs = $this->contentLanguage->getNsIndex( $foreignTitle->
getNamespaceName() );
82 if ( $targetNs !==
false ) {
83 return $this->titleFactory->makeTitleSafe( $targetNs, $foreignTitle->
getText() );
87 return $this->titleFactory->makeTitleSafe( 0, $foreignTitle->
getFullText() );
A simple, immutable structure to hold the title of a page on a foreign MediaWiki installation.
isNamespaceIdKnown()
Do we know the namespace ID of the page on the foreign wiki?
Internationalisation code See https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation for more...
A class to convert page titles on a foreign wiki (ForeignTitle objects) into page titles on the local...
TitleFactory $titleFactory
NamespaceInfo $namespaceInfo
Language $contentLanguage
__construct(Language $contentLanguage, NamespaceInfo $namespaceInfo, TitleFactory $titleFactory)
createTitleFromForeignTitle(ForeignTitle $foreignTitle)
Determines which local title best corresponds to the given foreign title.
This is a utility class for dealing with namespaces that encodes all the "magic" behaviors of them ba...
Represents an object that can convert page titles on a foreign wiki (ForeignTitle objects) into page ...