MediaWiki REL1_39
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 28 of file ForeignTitle.php.

Constructor & Destructor Documentation

◆ __construct()

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 47 of file ForeignTitle.php.

Member Function Documentation

◆ __toString()

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 106 of file ForeignTitle.php.

References isNamespaceIdKnown().

◆ getFullText()

ForeignTitle::getFullText ( )

◆ getNamespaceId()

ForeignTitle::getNamespaceId ( )
Returns
int
Exceptions
MWExceptionIf isNamespaceIdKnown() is false, it does not make sense to call this function.

Definition at line 70 of file ForeignTitle.php.

Referenced by NaiveImportTitleFactory\createTitleFromForeignTitle().

◆ getNamespaceName()

ForeignTitle::getNamespaceName ( )
Returns
string

Definition at line 79 of file ForeignTitle.php.

Referenced by NaiveImportTitleFactory\createTitleFromForeignTitle().

◆ getText()

ForeignTitle::getText ( )

◆ isNamespaceIdKnown()

ForeignTitle::isNamespaceIdKnown ( )

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

Returns
bool

Definition at line 61 of file ForeignTitle.php.

Referenced by __toString(), and NaiveImportTitleFactory\createTitleFromForeignTitle().


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