MediaWiki master
MediaWiki\Title\ForeignTitle Class Reference

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

Inherits Stringable.

Collaboration diagram for MediaWiki\Title\ForeignTitle:

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 33 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 52 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 110 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 74 of file ForeignTitle.php.

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

◆ getNamespaceName()

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

Definition at line 83 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 66 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: