MediaWiki master
MediaWiki\Title\NamespaceImportTitleFactory Class Reference

A class to convert page titles on a foreign wiki (ForeignTitle objects) into page titles on the local wiki (Title objects), placing all pages in a fixed local namespace. More...

Inherits MediaWiki\Title\ImportTitleFactory.

Collaboration diagram for MediaWiki\Title\NamespaceImportTitleFactory:

Public Member Functions

 __construct (NamespaceInfo $namespaceInfo, TitleFactory $titleFactory, int $ns)
 
 createTitleFromForeignTitle (ForeignTitle $foreignTitle)
 Determines which local title best corresponds to the given foreign title.
 

Detailed Description

A class to convert page titles on a foreign wiki (ForeignTitle objects) into page titles on the local wiki (Title objects), placing all pages in a fixed local namespace.

Definition at line 30 of file NamespaceImportTitleFactory.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Title\NamespaceImportTitleFactory::__construct ( NamespaceInfo  $namespaceInfo,
TitleFactory  $titleFactory,
int  $ns 
)
Parameters
NamespaceInfo$namespaceInfo
TitleFactory$titleFactory
int$nsThe namespace to use for all pages

Definition at line 42 of file NamespaceImportTitleFactory.php.

References MediaWiki\Title\NamespaceInfo\exists().

Member Function Documentation

◆ createTitleFromForeignTitle()

MediaWiki\Title\NamespaceImportTitleFactory::createTitleFromForeignTitle ( ForeignTitle  $foreignTitle)

Determines which local title best corresponds to the given foreign title.

If such a title can't be found or would be locally invalid, null is returned.

Parameters
ForeignTitle$foreignTitleThe ForeignTitle to convert
Returns
Title|null

Implements MediaWiki\Title\ImportTitleFactory.

Definition at line 62 of file NamespaceImportTitleFactory.php.

References MediaWiki\Title\ForeignTitle\getText().


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