MediaWiki master
MediaWiki\Title\ForeignTitle Class Reference

A simple, immutable structure to hold the title of a page on a foreign MediaWiki installation. More...

Public Member Functions

 __construct ( $namespaceId, $namespaceName, $pageName)
 Creates a new ForeignTitle object.
 
 __toString ()
 Returns a string representation of the title, for logging.
 
 getFullText ()
 
 getNamespaceId ()
 
 getNamespaceName ()
 
 getText ()
 
 isNamespaceIdKnown ()
 Do we know the namespace ID of the page on the foreign wiki?
 

Detailed Description

A simple, immutable structure to hold the title of a page on a foreign MediaWiki installation.

Definition at line 32 of file ForeignTitle.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Title\ForeignTitle::__construct ( $namespaceId,
$namespaceName,
$pageName )

Creates a new ForeignTitle object.

Parameters
int | null$namespaceIdNull if the namespace ID is unknown (e.g. interwiki links)
string$namespaceName
string$pageName

Definition at line 51 of file ForeignTitle.php.

Member Function Documentation

◆ __toString()

MediaWiki\Title\ForeignTitle::__toString ( )

Returns a string representation of the title, for logging.

This is purely informative and must not be used programmatically. Use the appropriate ImportTitleFactory to generate the correct string representation for a given use.

Returns
string

Definition at line 109 of file ForeignTitle.php.

References MediaWiki\Title\ForeignTitle\isNamespaceIdKnown().

◆ getFullText()

MediaWiki\Title\ForeignTitle::getFullText ( )

◆ getNamespaceId()

MediaWiki\Title\ForeignTitle::getNamespaceId ( )
Note
Callers should make sure that isNamespaceIdKnown() is true before calling this method.
Returns
int

Definition at line 73 of file ForeignTitle.php.

Referenced by MediaWiki\Title\NaiveImportTitleFactory\createTitleFromForeignTitle().

◆ getNamespaceName()

MediaWiki\Title\ForeignTitle::getNamespaceName ( )
Returns
string

Definition at line 82 of file ForeignTitle.php.

Referenced by MediaWiki\Title\NaiveImportTitleFactory\createTitleFromForeignTitle().

◆ getText()

MediaWiki\Title\ForeignTitle::getText ( )

◆ isNamespaceIdKnown()

MediaWiki\Title\ForeignTitle::isNamespaceIdKnown ( )

Do we know the namespace ID of the page on the foreign wiki?

Returns
bool

Definition at line 65 of file ForeignTitle.php.

Referenced by MediaWiki\Title\ForeignTitle\__toString(), and MediaWiki\Title\NaiveImportTitleFactory\createTitleFromForeignTitle().


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