MediaWiki REL1_37
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...

Inheritance diagram for NamespaceImportTitleFactory:
Collaboration diagram for 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.
 

Private Attributes

int $ns
 
TitleFactory $titleFactory
 

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 26 of file NamespaceImportTitleFactory.php.

Constructor & Destructor Documentation

◆ __construct()

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

Definition at line 38 of file NamespaceImportTitleFactory.php.

References $ns, $titleFactory, and NamespaceInfo\exists().

Member Function Documentation

◆ createTitleFromForeignTitle()

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 ImportTitleFactory.

Definition at line 58 of file NamespaceImportTitleFactory.php.

References ForeignTitle\getText().

Member Data Documentation

◆ $ns

int NamespaceImportTitleFactory::$ns
private

Definition at line 31 of file NamespaceImportTitleFactory.php.

Referenced by __construct().

◆ $titleFactory

TitleFactory NamespaceImportTitleFactory::$titleFactory
private

Definition at line 28 of file NamespaceImportTitleFactory.php.

Referenced by __construct().


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